Regarding seamless integration of Bitbucket repositories with Azure DevOps pipelines

chaitu_trxs 0 Reputation points
2024-06-10T11:34:47.03+00:00

Hi,

We are trying to automatically trigger Azure DevOps pipelines based on trigger rules set in the YAML code, as per the documentation here. However, we are encountering an issue where Bitbucket creates a webhook for both Pull Request and Push triggers, and irrespective of the branch name, it is triggering the pipeline(even though we have set the branch trigger rules in 'YAML' file as specified in the documentation).

For example, we have three branches: abc, def, and ghi. We've set the following triggers:

  • For branch abc (in file_x.yml):
      pr:
        branches:
          include:
          - abc
    
  • For branch def (in file_y.yml):
      trigger:
        branches:
          include:
          - def
    
  • For branch ghi (in file_z.yml):
      trigger:
        branches:
          include:
          - ghi
    

We have also created three separate pipelines, each using one of the YAML files (file_x.yml, file_y.yml, file_z.yml). The issue is that whenever a 'push' happens to any branch, all three pipelines are triggering (they shouldn't because of the branch rules set in the YAML files for def and ghi). Similarly, when a PR is raised, all three pipelines trigger (which should not happen, as only the abc branch pipeline should trigger).

We reached out to Bitbucket support and they replied that for every webhook request, they are sending the response of the branch name to the Azure DevOps pipelines. They asked us to handle that part on the Azure pipeline side. Despite our efforts to restrict the triggers based on the branch rules set in the YAML files, it is triggering for all branches.

We have followed the documentation exactly here(for Bitbucket repos), using the YAML code method, but it didn’t work. We also tried the 'classic' method by setting the 'include' branches in the trigger rules in the pipeline UI, but it still didn’t work. We need your help in resolving this issue. Is there any way or approach we can use to restrict the trigger based on the branch rules we set?

Thank you for your assistance.

Community Center | Not monitored
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. ManoharLakkoju 710 Reputation points Microsoft External Staff Moderator
    2024-06-10T13:30:23.16+00:00

    @chaitu_trxs
    Welcome to Microsoft Q&A Platform, thanks for posting your query here. Azure DevOps related queries/issues are currently not supported on this Microsoft Q&A platform.

    I would request you to please post your queries in dedicated forums as in below links:

    https://developercommunity.visualstudio.com/spaces/21/index.html

    https://developercommunity.visualstudio.com/t/get-unique-id-from-devops-organization/756710

    https://stackoverflow.com/questions/tagged/azure-devops

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.