Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Trigger Azure Piplines build based on BitBucket Pull Request

Does anyone know how to trigger Azure Pipeline builds (not bitbucket builds) based on Bit Bucket PRs?

3 answers

We came up with two workarounds.

1. PowerAutomate. We created a Microsoft Power Automate flow to do what we wanted. The flow uses the Bitbucket Connector to capture a WebhookPullRequestMergedResponse, and the Azure Devops Connector to queue an Azure Pipelines build. Unfortunately, these two connectors require a premium license, and we're not willing to pay for that right now. So, even though this is a good solution, we're not going to pursue it further.

2. Our own little webserver. We created our own webhook(s) in the Bitbucket repository for PR events like pullrequest:merged. When a webhook is triggered, it sends a notification to a webserver that we have running on an existing Azure VM. The event payload is parsed, and a build request is sent to our our Azure DevOps build server, using the Azure DevOps REST API. This is the solution we're going with.

Either workaround adds another machine to the process flow, but that can't be avoided.

(Three years later)

There is a way to do this now, but it's still not perfect.

See the "PR triggers" section of this document: https://docs.microsoft.com/en-us/azure/devops/pipelines/repos/bitbucket?view=azure-devops&tabs=yaml#pr-triggers

Unfortunately, the PR trigger only works when a PR is created or updated, but not on the merge commit. The Azure documention reference above says:

Each new run builds the latest commit from the source branch of the pull request. This is different from how Azure Pipelines builds pull requests in other repositories (e.g., Azure Repos or GitHub), where it builds the merge commit. Unfortunately, Bitbucket does not expose information about the merge commit, which contains the merged code between the source and target branches of the pull request.

I'm searching the Atlassian Community right now for more information on that last sentence. (That's how I ran across this question.)

Another update.

Atlassian has created a Jira ticket for this issue, see BBCLOUD-20718.

It's still in status "Gathering Interest". Currently it only has 13 votes. If more users vote for it, perhaps Atlassian will give it more priority and work on it.

0 votes
davina
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
Jun 25, 2019

Hi @Karthik Kotha 

Currently there doesn't seem to be an existing plugin between Azure Pipelines and Bitbucket. There is one for Jira as you can see here.

You can however set up Bitbucket Pipelines in your Bitbucket repository to trigger Azure deployments on your PRs. We also have Bitbucket pipes which wrap up this functionality for you. Here are some docs you might find useful:

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events