Skip to main content
Skip table of contents

Azure DevOps Pipeline trigger from Bitbucket Server

This documentation won't be maintained anymore.

Please visit our up-to-date documentation for Post Webhooks for Bitbucket to be in the loop on the latest improvements and features.


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


To trigger an Azure DevOps pipeline, you need to set up the link to the pipeline and configure the 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, ensure that outgoing traffic is allowed from your Bitbucket Server to the Azure DevOps infrastructure.

Azure DevOps pipeline parameters

You need to make sure that the parameters of the pipeline are settable at the queue time.

Follow this guide from Microsoft.

If you want to update the build status in Bitbucket from the 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.

  • 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).

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


JavaScript errors detected

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

If this problem persists, please contact our support.