Skip to main content
Skip table of contents

How to set up Azure DevOps Pipeline triggering from Bitbucket Server?

By integrating Post Webhooks for Bitbucket with Azure DevOps Pipelines, you can achieve tighter integration between your Bitbucket repositories and your CI/CD workflows, enabling seamless automation and ensuring that your code is always up to date and properly deployed.

Getting the personal access token

To move forward with the configuration of Azure DevOps Pipeline triggering, we recommend you first obtain a Personal Access Token (PAT) to connect your Confluence and Azure DevOps instances. You can use a service account to generate this PAT but do remember that Microsoft forces you to log in every 90 days to keep the PATs active.

The following steps will help you create a new Personal Access Token:

  1. Navigate to the User Settings in the right corner of the navigation menu.

  2. From the drop-down, select Personal access tokens.

  3. Click on the New Token button and generate a new personal access token with minimal scope. Currently, the App needs the token to Read access to the builds.

Alternatively, you can use this official guide from Microsoft.

Configuration

Once you have got the Personal Access Token, you can proceed with the configuration of Azure DevOps Pipeline triggering. Configuration of Azure DevOps Pipeline triggering is available on all configuration levels:

Global Configurations for Bitbucket admins

Project Level Configurations

Repository Level Configurations

  1. Find our application Post Webhooks on the level that suits your needs best: Global, Project, or Repository.

  2. Click on Add webhook button in the left corner and create a new configuration.

  3. Tick the checkbox Trigger Azure DevOps pipeline and specify all the necessary parameters.

  4. After you have specified all the necessary parameters click on the Save button.

Below you can find a short definition of the parameters you have to specify:

Parameter

Definition

Title

the name of the configuration

Our advice is to name something meaningful to you and your team so that it can be understood later easier

Trigger Azure DevOps pipeline

allows you to specify the Azure DevOps pipeline that should be triggered when the webhook event occurs.

URL

a link to the pipeline by pattern:

Azure source

specifies where the target pipeline is located:

  • Cloud;

  • Server.

Personal Access Token

the personal access token (PAT) used for authentication with Azure DevOps.

Target Azure DevOps Branch

the branch in the Azure DevOps repository where the pipeline to be triggered is located.

Parameters to send

additional parameters or variables that need to be passed to the Azure DevOps pipeline when triggering it.

Status

Active checkbox should be enabled if this configuration is going to be used.

Repository events

Pull request events

allows you to specify the types of events that should trigger the pipeline.

The rest parameters are optional to provide flexibility and customization options to tailor the webhook integration according to your specific needs.

Azure DevOps pipeline parameters

If you want to update the build status in Bitbucket from the Azure DevOps pipeline, you may need to use some defined parameters. For some Bitbucket events, some parameters are not available and as a result, they are not sent to the Azure DevOps pipeline.

Please, make sure that the parameters of the pipeline are settable at the queue time.

Follow this guide from Microsoft and check out our short video explainer.

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

Parameter

Definition

projectKey

the Bitbucket project key.

projectName

the Bitbucket project’s name.

repositorySlug

the Bitbucket repository slug.

repositoryName

the Bitbucket repository's name.

commit

the git commit hash.

commitMessage

optional commit message.

branch

the git branch name.

sourceBranch

the git source branch for pull request events.

destinationBranch

the git destination branch for pull request events.

userDisplayName

the user's (actor) display name.

userSlug

the user's slug.

eventType

the event type.

pullRequestId

the id of the pull request (only pull request-related events).

pullRequestTitle

the title of the pull request (only pull request-related events).

pullRequestDescription

the description of the pull request (only pull request-related events).

pullRequestState

the state of the pull request (only pull request-related events).

Demo Video

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

Updated:

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.