AZ-400 Question 160
Select 2You manage an Azure DevOps multi-stage YAML pipeline to deploy three microservices: Microservice A, Microservice B, and Microservice C. Microservice A must be updated before Microservice B, and Microservice B must be updated before Microservice C. You need to ensure that the deployment pipeline always respects this order. Which two actions should you take to reliably enforce the required deployment sequence?
- A
Configure each stage's 'dependsOn' property to reference the previous microservice's stage
- B
Use a manual intervention task to approve deployments for each microservice individually
- C
Set up a separate release pipeline for each microservice without inter-pipeline dependencies
- D
Define a custom condition that validates the successful completion of the dependent microservice in each stage
Show answer and explanation
Correct answers: A, D
Explanation
To ensure dependencies are deployed in the correct order, define stage dependencies and custom conditions in your Azure DevOps YAML pipeline. The 'dependsOn' attribute is documented in the Microsoft Azure DevOps documentation (https://docs.microsoft.com/azure/devops/pipelines/process/stages?view=azure-devops), and custom conditions (https://docs.microsoft.com/azure/devops/pipelines/process/conditions?view=azure-devops) can further ensure the sequence. Both approaches work together to make pipeline execution more reliable and to prevent microservice B and C from deploying before their dependencies are satisfied.
- A. Correct.
Correct. In Azure Pipelines YAML, you can define dependencies between stages by using the 'dependsOn' attribute. This enforces that B won't start until A completes, and C won't start until B completes.
- B. Incorrect.
Incorrect. While manual intervention tasks can pause the pipeline, they do not inherently enforce a strict sequence or dependency ordering. They rely on a person to trigger the next step, which is less reliable for automated ordering.
- C. Incorrect.
Incorrect. Having separate release pipelines without referencing each other does not guarantee dependency order. Without explicit dependencies, microservices can be triggered independently in any order.
- D. Correct.
Correct. Custom conditions in a given stage can ensure that the stage only proceeds if the preceding microservice deployment succeeded. This is another reliable method to enforce an ordered deployment workflow.