Integrating Azure DevOps Pipelines with Bitbucket Repositories

Deleted user May 31, 2024

We have built Azure DevOps pipelines off of Bitbucket repositories. And we are trying to trigger the pipeline based on 'pullrequest' or 'push' to certain branches using Azure devops yaml code documentation here which specifies the exact code to be used while using Bitbucket repositories.

The problem is that, whenever we create a new pipeline in Azure DevOps, a 'webhook' is being created and it is behaving in a weird way. For example let's say we have 3 branches, 'abc', 'def' and 'ghi', and when we create 'pr' trigger for one branch 'abc', the 'webhook' is triggering pipeline for PRs raised againist 'def' and 'ghi', and the same goes for 'push' trigger. When set for one branch, the 'webhook' is triggering all the pipelines no matter the branch in which the push is made. And we want to avoid this and clearly communicate to the 'webhook' that only trigger based on the trigger rules of a particular branch and not every branch in the repository. 

We are stuck with this issue and were unable to find any solution even after a lot of research. So we seek some help here and also if there is any private channel to ask questions and get answers please guide us through so that we can have more indepth discussion about the issue we are facing.

1 answer

1 accepted

0 votes
Answer accepted
Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 5, 2024

Hi @[deleted] and welcome to the community!

Webhooks cannot be triggered only on certain branches. A webhook with trigger Push will get triggered on every push to a repository, regardless of the branch. The branch is included in the event payload, so the server that receives the request can examine the payload, find out the branch, and then take action or not depending on the branch.

The integration between Bitbucket Cloud and Azure DevOps pipelines is not built by Atlassian, so we don't know what happens on the server that receives the webhook's payload and what configuration is needed to achieve what you want. I suggest reaching out to the Azure Devops Pipelines team to double-check if you're following the correct steps to setup the integration and ask if there is any configuration needed to prevent pushes in a branch from triggering all the pipelines.

Kind regards,
Theodora

Deleted user June 6, 2024

@Theodora Boudale , and thanks a lot for answering our queries.

I read your answer, so you're saying that even though we followed the Azure DevOps documentation here to define branch rules and enable the webhook, the webhook still bypasses the branch rules and just follows its push or pull request configuration. We can't configure the webhook further, correct?

Also, the webhook sends branch data as payload, and you want us to contact Azure DevOps to handle this branch payload on the pipeline side, right? If that is the case, we will try to reach out to Azure Devops team and ask them the questions.

Theodora Boudale
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
June 7, 2024

Hi @[deleted],

You are very welcome.

The webhook is not aware of any rules set on the destination server in order to bypass them, it will simply be triggered when new commits are added to the repo (in case the trigger is Push). It cannot be configured further to be triggered on push to certain branches, that is correct.

Since the branch name is included in the payload, the server that receives the webhook (in this case, the Azure DevOps server) can find the branch in the event payload and then perform an action or not accordingly. The Azure DevOps team should be able to answer your questions about how the payload event is handled and what configuration you need to make to achieve what you want.

Kind regards,
Theodora

Deleted user June 7, 2024

Thank you @Theodora Boudale , we will reach out to Azure DevOps team on this one.

Like Theodora Boudale likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events