Demo

You can trigger Microsoft Azure DevOps pipelines Cloud and Server from Bitbucket Server or Data Center.

https://www.youtube.com/watch?v=qq8PudEqhuE

Setup

In order to trigger an Azure DevOps pipeline you need to setup the link to the pipeline and configure personal access token (PAT).

Below the URL field you can see the url pattern.

You can copy the url from the browser when you navigate the Azure DevOps Pipeline definition.

When you create a PAT please make sure the token has the minimal scope - Build → Read & execute.

Additionally, do make sure that outgoing traffic is allowed from your Bitbucket Server to the Azure DevOps infrastructure.

Azure DevOps pipeline parameters

In case you want to update the build status in Bitbucket from Azure DevOps pipeline you may need to use some parameters.

The following parameters are passed to the pipeline when it is triggered.

  • projectKey - the Bitbucket project key.

  • repositorySlug - the Bitbucket repository slug.

  • commit - the git commit hash.

  • branch - the git branch name.

For some Bitbucket events some parameters are not available, as a result, they are not sent to Azure DevOps pipeline.