Search code examples
azureazure-devopspipelinepull-requestcicd

Prevent Azure Devops CI Pipeline From Triggering until Two People Approve the Pull Request


I have a pipeline that builds a docker image & push to ACR. My Requirement is to prevent the pipeline Build policy from triggering until two people approve the pull Request.

Currently when the pull request is created the build automatically start running, without waiting for pull request to be approved.


Solution

  • Azure DevOps doesn't provide triggers for this level of control. You should control this not with your build server, but with your source control. You should prevent certain stages/jobs/tasks from running by using branch filters. I always build PRs and make them part for the approval process. Waiting for approvals is antithetical to DevOps practices.

    Always build on PRs, but only save images when you have merged the PR.