1
votes

In my release pipeline I have configured build artifact. Enabled the 'continuous deployment trigger' (not added any branch filter) and disabled 'Pull request trigger'. Now when I raise PR, then the PR triggers a build (since I also have build validation configured in branch policy).

Once build completes, it triggers a release. Why does this happen when I have the "pull request trigger" disabled? Why is build due to a PR triggering a release when the "pull request trigger" on the build artifact is disabled?

The triggering of release prior to PR completion is prevented only when I add a branch filter to the "continuous deployment trigger".

2

2 Answers

2
votes

Here I'll restore your scene and add some screenshots to illustrate it.

First we need to understand the definition of Continuous deployment triggers:

This instructs Azure Pipelines to create new releases automatically when it detects new artifacts are available.

Because you set the pr build vaildation policy, when a pr is created, it will automatically trigger a pr build.

enter image description here

At this time, this pr build is equivalent to generating a new available artifact, which will automatically trigger the release.

enter image description here

This release is actually caused by Continuous deployment trigger, not because of Pull request trigger.

2
votes

This the expected behavior, if you configured CD to any branch so after build is finished the release is started, no matter if the build is queued by Pull Request.

If you want to upload artifacts in part of the PR you should disable the CD trigger or use the artifacts filter.

Please read here and here the PR trigger docs.