After talking about Azure DevOps Environments in general and then looking into the specific implementations for Azure Virtual Machines and for Kubernetes Clusters, it is now time for a deep dive into Checks and Gates.
Let's take a look at all the Checks and Gates available in an Azure DevOps Environments and see how we can use them for deployment control!
I want tp talk about all the Gates and Checks available in Azure DevOps Environments for controlling the release process.
This post is part of the series dedicated to the Azure DevOps Environments, series in which I've already covered the Pipelines environments in general, as well as the specific implementations for Virtual Machines and Kubernetes cluster.
Today instead we will go through all the Checks that we can configure inside an Environment (at least all the ones available at the time of writing) and we'll see how we can use them to orchestrate our deployments.
There are currently 9 different types of check available in Azure Pipelines Environments:
To enable a check, we need to go in an Environment and click on "Approvals and Checks" on the ellipses menu on the upper right
Right, let's jump now into Azure DevOps and analyze all the checks, how to use them, and what benefits they provide.
Enjoy the watch!
This is probably the most used one. Just add the people or group you want to ask approval for a specific stage, and they will receive the notification.
The check requires the branch names to be fully qualified. Make sure the format for branch name is
I've cover this previously in this other video. This check basically allows you to define deployment windows and so your stages will run only during those windows.
With this check you can evaluate artifact(s) to be deployed to an environment against custom policies.
Remember that currently this works only with container image artifacts.
When you run a pipeline, as usual the execution of that run pauses before entering a stage that uses the environment and the specified policy is evaluated against the available image metadata.
The check passes when all the policies are successfully evaluated against the artifact
You can also see the complete logs of the policy checks from the pipeline view.
If any of the policy fails, instead, the whole check fails and the stage is marked failed as well.
Again, you can also see the complete logs of the policy checks and the ones which failed from the pipeline view.
This is pretty interesting.
You can ensure that only a single run deploys to an environment at a time. By choosing the "Exclusive lock" check on an environment, only one run will proceed. Subsequent runs which want to deploy to that environment will be paused. Once the run with the exclusive lock completes, the latest run will proceed. Any intermediate runs will be canceled.
In case the Azure Function executes for more than 1 minute, you'll need to use the Callback completion event instead of the API Response one. API Response completion option is supported for requests that complete within 60 seconds.
This is very similar to the previous one, with the difference that the URL and the authentication is defined in the Service Connection rather than in the check itself.
I want to spend a moment talking about this one because I think the documentation is a little misleading.
If we read the part here highlighted in yellow, in fact, it says that "Query Azure Monitor Alerts helps you observe Azure Monitor and ensure no alerts are raised for the application __AFTER A DEPLOYMENT_ _"
Reading this may lead you to think that this check is executed AFTER the stage runs, while in reality it is still a PRE-Deployment check.
What you can do for being sure the application you have just deployed is working correctly is then deploying it in a stage, and then add another stage which just target the environment that contains this check. Not super streamlined, but it works.
With this check, you can enforce pipelines to use a specific YAML template. When this check is in place, a pipeline will fail if it doesn't extend from the referenced template.
We now have a quite good understanding of how we can control our deployments with Azure Pipelines and the checks embedded into Environments.
Let me know in the comment section below if you have any questions about them.