AZ-400 Question 126
Single answerYou are designing a multi-stage YAML pipeline in Azure DevOps for a .NET web application. The pipeline includes separate Build, Test, and Deploy stages. The team requires that any production deployment must be reviewed and approved by a release manager before proceeding. Which configuration should you implement to ensure that the pipeline automatically waits for manual approval before executing the production deployment?
- A
Define a pre-deployment approval check on the production environment in Azure DevOps, and reference that environment in the production deployment stage.
- B
Add a manual validation task in the Build stage that requires the release manager� input to continue.
- C
Use a custom variable, such as productionApprovalRequired=true, and conditionally execute the production deployment based on that variable.
- D
Create a separate pipeline exclusively for production deployments and trigger it manually.
Show answer and explanation
Correct answer: A
Explanation
Azure DevOps allows you to define approvals and checks on environments to implement manual interventions, such as release manager approvals, in a multi-stage YAML pipeline. By setting a pre-deployment approval on the production environment, the pipeline will pause at the production stage and wait for the designated approver to grant permission before it proceeds. Refer to the Azure DevOps documentation on 'Approvals and checks for environments' for detailed guidance.
- A. Correct.
Correct: In Azure DevOps, configuring a pre-deployment (or environment) approval on the production environment and referencing that environment in your YAML pipeline ensures the pipeline stalls at the production stage until the release manager grants approval.
- B. Incorrect.
Incorrect: Adding a manual validation task in the Build stage would interrupt the workflow prematurely. The requirement is to approve the production deployment, not the build.
- C. Incorrect.
Incorrect: Using a custom variable and conditional logic might prevent the deployment from running automatically, but it does not provide a formal manual approval mechanism or a clear chain of responsibility.
- D. Incorrect.
Incorrect: Creating a separate pipeline for production only offers a workaround rather than a direct solution. It also introduces extra overhead, and it still does not integrate a formal manual approval in the same pipeline flow.