Check policy compliance with gates.
Prepare -
1. Create an Azure Policy in the Azure portal. There are several predefined sample policies that can be applied to a management group, subscription, and resource group.
2. In Azure DevOps create a release pipeline that contains at least one stage, or open an existing release pipeline.
3. Add a pre- or post-deployment condition that includes the Security and compliance assessment task as a gate.

Reference:
https://docs.microsoft.com/en-us/azure/devops/pipelines/policies/azure-policy