AZ-400 exam dumps

AZ-400 practice question 161 of 306

Designing and Implementing Microsoft DevOps Solutions. Professional level, Microsoft. Free question with the correct answer and a full explanation.

AZ-400 Question 161

Single answer

You manage a multi-stage YAML pipeline in Azure DevOps that deploys a new schema to an Azure SQL Database and then deploys an ASP.NET Core web application that relies on that updated schema. You want to ensure that the web application is only deployed after the database schema deployment completes successfully. Which approach should you use to enforce reliable ordering of your deployments?

  1. A

    Add a 'dependsOn' attribute to the web application stage so it runs only after the database stage has succeeded

  2. B

    Create two separate release pipelines for database and web app, then manually trigger the web app pipeline after the database deployment finishes

  3. C

    Insert a manual approval gate after the database deployment completes and before starting the web app deployment

  4. D

    Place both tasks (database and web app) in the same job to let the pipeline handle concurrency automatically

Show answer and explanation

Correct answer: A

Explanation

By using the 'dependsOn' property in a multi-stage YAML pipeline, you enforce an explicit order for dependent stages (e.g., database deployment stage followed by web app deployment stage). This practice aligns with Microsoft DevOps best practices for ensuring that components with dependencies do not deploy prematurely. For more details, refer to the official Azure DevOps documentation on stage dependencies: https://docs.microsoft.com/azure/devops/pipelines/process/stages#stage-dependencies.

  • A. Correct.

    Correct. Defining a stage dependency (via the 'dependsOn' property in YAML) is the recommended way to ensure a stage only executes after a specific preceding stage has completed successfully. It aligns with best practices for reliable ordering of dependent deployments.

  • B. Incorrect.

    Incorrect. While using separate release pipelines and manually triggering them can work, it is error-prone and does not provide an automated, dependable sequence if integrations or automatic triggers are needed.

  • C. Incorrect.

    Incorrect. A manual approval gate can introduce human intervention but does not inherently ensure that any specific tasks from the prior stage have run unless properly configured. It also reduces automation and can slow down deployments unnecessarily.

  • D. Incorrect.

    Incorrect. Placing both tasks in the same job and relying on concurrency does not guarantee the right order. Parallel execution can cause the web app to be deployed before the database schema finishes updating, leading to potential failures.

Timed practice exam

Take a AZ-400 practice test under exam conditions

70 questions in 90 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam