Designing Quality and Release Gates
This lesson explains the difference between the two kinds of gate, including security and governance gates.
Learning outcomes
After completing this lesson, you will be able to:
- Distinguish quality gates from release gates.
- Identify checks that act as release gates.
- Explain security and governance gates.
- Choose a gate from stated requirements.
Quality gates and release gates
The two terms describe a difference in position. A quality gate usually applies to code and build output, and it runs within a pull request or a build. It asks whether a change is good enough to proceed. A release gate applies at the entry to a stage or environment. It asks whether it is right to deploy now, and may consider things outside the code, such as active incidents or a change window.
A gate should be automatic whenever a rule can be expressed, because a person who approves dozens of routine releases stops looking carefully. A manual approval is justified where human judgment adds something, such as a business decision on timing.
Quality gate or release gate?
Quality gates in practice
Quality gates appear as required checks on a pull request, or as steps that fail a run. Typical conditions include the following.
- All required tests pass.
- Code coverage on changed code meets a threshold.
- Static analysis and linters report no new high-severity issues.
- Dependency and secret scans find nothing blocking.
- Infrastructure templates pass validation and policy checks.
Gates should be strict about new problems and more tolerant of old ones. A rule that fails every build until 3,000 historic issues are fixed will soon be switched off. A rule that blocks only new issues improves quality steadily without stopping delivery.
Gates that teams keep
Release gates with environment checks
In YAML pipelines, release gates are implemented as checks on an environment, or on another protected resource such as a service connection. The lesson on checks and approvals explains the full list. The checks commonly used as gates are as follows.
| Check | What it asks |
|---|---|
| Query Azure Monitor Alerts | Are any matching alerts active? |
| Invoke REST API | Does an external system, such as change management, approve? |
| Invoke Azure Function | Does custom logic allow the release? |
| Business hours | Is it within the allowed time window? |
| Evaluate artifact | Does a container image meet a policy? |
| Required template | Does the pipeline extend an approved template? |
| Approvals | Has a named person agreed? |
Checks can be re-evaluated at intervals until they pass or a timeout expires. This allows a gate to wait for a condition, such as an alert clearing, rather than failing at once. In GitHub, environments offer required reviewers, wait timers and branch restrictions, and custom deployment protection rules use a GitHub App to call external systems.
The following diagram shows a Query Azure Monitor Alerts check holding or releasing a production stage.

Environment checks as release gates
Security and governance gates
A security gate makes a vulnerability a reason to stop. Examples include a required AdvancedSecurity/NewHighAndCritical status check in Azure Repos, a dependency review on GitHub pull requests, and a pipeline step that fails on a critical container image finding.
A governance gate confirms that a process has been followed. A Required template check proves that a pipeline runs mandatory steps, so a team cannot remove a scan from its own YAML. Azure Policy enforces rules at the Azure level: even a pipeline that passes every gate cannot create a resource that violates a Deny policy, which gives a final layer of control. Audit requirements are met by the record of approvals and checks kept in each run.
Security and governance gates
Preventing release during an incident
A team deploys with a multi-stage YAML pipeline in Azure Pipelines. During a recent outage, a scheduled release went to production and made diagnosis harder. Releases must wait while critical alerts are active, without anyone having to intervene. What should you configure?
Add a Query Azure Monitor Alerts check to the production environment, with suitable filters and a retry interval and timeout. The check holds the stage while alerts are active and allows it when they clear. A manual approval would need someone to watch for incidents. A step inside the YAML could be changed or removed by the pipeline author, and it would run after the deployment job had begun, whereas a check on the environment is applied before the stage starts.
Why is a check on an environment stronger than a step in the YAML?
Show answer
The environment owner sets a check, so a pipeline author cannot remove it, and it applies before the stage starts.
Exam Tips
Remember for the exam
- A quality gate judges the change; a release gate judges whether to deploy now.
- Automate gates where a rule can be stated.
- Block new high-severity issues rather than all historic ones.
- Environment checks are the YAML form of release gates.
- Required template proves that mandatory steps cannot be removed.