I read a few posts about it, but most of them are quite old, and Azure DevOps probably doesn't support this feature. I have my pipeline that builds a project and pushes the artifact.
Then, the release pipeline should start. In my release pipeline, I have different environments (Stages). The deployment in DEV
is straightforward when there is change in the dev
branch, but to start the deployment in the other environments, an approval is always required.
So, when the developers update the dev
branch, a new release pipeline is created to deploy the latest artifact. As you can see in the screenshot above, the Release 9 doesn't start because the Release 8 is not completed.
Manually, I have to cancel the Release 8 and then the Release 9 starts.
Is there a command or some configuration that allows me to cancel the previous release if a new one is created?
There is a feature of Classic Release pipelines in Azure DevOps called Deployment queue settings that can define the behavior of subsequent releases.
The default setting is "Deploy all in sequence". By changing this value to "Deploy latest and cancel the others" newer releases will cancel the approval on existing stages.
Although there isn't an equivalent for YAML-based pipelines, I have an extension that can emulate this behavior.