Approval gates and manual interventions help teams manage risk and enforce review protocols within CI/CD pipelines. In this article, we’ll explore how to set up pre-deployment approvals, post-deployment approvals, and manual intervention steps in Azure Pipelines, ensuring greater control and accountability in release management.
What Are Approval Gates and Manual Interventions?
Approval gates and manual interventions are tools used to control the flow of a release pipeline:
- Approval Gates: Require specific individuals or groups to approve a deployment before it proceeds to the next stage.
- Manual Interventions: Pause a deployment at a specific point, allowing teams to perform checks or updates before continuing.
Step 1: Configuring Pre-Deployment Approvals
Pre-deployment approvals ensure that a deployment does not begin until a designated user or team grants approval:
- Navigate to Release Pipeline: In Azure DevOps, go to “Pipelines” > “Releases” and select the release pipeline you want to configure.
- Select Stage Settings: Choose the stage where you want to add an approval gate and click on the “Pre-deployment conditions” icon.
- Enable Pre-Deployment Approvals: Toggle on “Pre-deployment approvals” and add approvers who must approve the deployment before it begins.
- Set Approval Timeout: Specify a timeout to ensure deployments proceed if approvals are delayed, or automatically cancel if no approval is granted within the defined period.
Step 2: Configuring Post-Deployment Approvals
Post-deployment approvals allow you to validate the success of a deployment before proceeding to the next stage:
- Select Post-Deployment Conditions: In the stage settings, choose “Post-deployment conditions.”
- Enable Post-Deployment Approvals: Toggle on “Post-deployment approvals” and add approvers who must approve before the release moves forward.
- Configure Approval Options: Set conditions for approval, such as requiring multiple approvers or specific team members.
Step 3: Adding Manual Intervention Steps
Manual intervention steps create checkpoints within the pipeline, pausing deployment until someone manually resumes it:
- Open the Stage’s Tasks: In the release pipeline, select the stage and go to “Tasks.”
- Add Manual Intervention Task: Add a task called “Manual Intervention” at the desired point in the deployment sequence.
- Configure Manual Instructions: Provide instructions for what reviewers should check or verify before resuming.
When the pipeline reaches a manual intervention step, it pauses and waits for a user to either approve or reject the continuation.
Step 4: Automating Approval Notifications
Azure DevOps can send notifications to designated approvers when an approval gate is reached:
- Email Notifications: Configure email notifications in Azure DevOps settings to notify approvers of pending approvals.
- Teams or Slack Notifications: Use Azure DevOps integrations with Microsoft Teams or Slack to notify team members of approvals required, enabling faster responses.
Best Practices for Approval Gates and Manual Interventions
To maximize the effectiveness of approvals and interventions, follow these best practices:
- Set Clear Approval Criteria: Define clear criteria for approvers to follow when granting or rejecting approvals.
- Use Approvals Sparingly: Apply approval gates and interventions only where necessary to avoid bottlenecks.
- Automate Approvals for Lower Environments: Consider automating approvals for non-production environments to streamline testing while retaining approvals for production stages.
- Assign Multiple Approvers: Designate backup approvers to prevent delays if primary approvers are unavailable.
Conclusion
Approval gates and manual interventions in Azure Pipelines add a layer of control and accountability, enabling teams to manage risk more effectively in their deployment processes. By configuring these features in release pipelines, you can enforce necessary review steps, ensure that only approved code reaches production, and minimize the potential for errors. With a well-structured approval process, teams can maintain high-quality deployments and build trust in the CI/CD pipeline.