Courseiva

AZ-400 Practice Question: Design and implement build and release pipelines

You are configuring a multi-stage YAML pipeline in Azure Pipelines. The pipeline has stages for Build, Test, and Deploy. You need to ensure that the Deploy stage runs only if the Build and Test stages succeed, and that it uses a specific environment named 'Production' with an approval check. What should you do?

⚠ Common exam trap

Many exam-takers confuse YAML pipeline approvals with classic release pipeline approval gates, or thinking that a manual intervention task can be used in YAML for approvals.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

Add a dependsOn condition to the Deploy stage for Build and Test, and configure the environment 'Production' with an approval check.

In YAML pipelines, stage dependencies are defined with dependsOn, and approvals are configured on environments. The Deploy stage should depend on Build and Test, and the Production environment should have an approval check. This ensures the stage runs only after successful prior stages and requires approval.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✓

    Add a dependsOn condition to the Deploy stage for Build and Test, and configure the environment 'Production' with an approval check.

    Why this is correct

    Using dependsOn on the Deploy stage ensures it runs only after Build and Test succeed. Configuring the 'Production' environment with an approval check enforces manual approval before deployment. This combination meets both requirements: conditional execution and approval.

  • ✗

    Add a dependsOn condition to the Deploy stage for Build and Test, and use a manual approval task in the stage.

    Why it's wrong here

    While dependsOn is correct, using a manual approval task in YAML is not supported; approvals are configured on environments. Manual approval tasks are available in classic release pipelines, not YAML. This option incorrectly suggests a task-based approval.

  • ✗

    Use a condition on the Deploy stage to check the status of previous stages, and add an approval gate in the release pipeline.

    Why it's wrong here

    YAML pipelines do not have release pipelines; approval gates are a feature of classic release pipelines. In YAML, approvals are configured via environments. Using a condition is possible but not as straightforward as dependsOn, and the approval gate reference is incorrect for YAML.

  • ✗

    Set the Deploy stage to run always, and use a manual intervention task before deployment.

    Why it's wrong here

    Running always would cause the Deploy stage to run even if Build or Test fail, which is not desired. A manual intervention task provides approval but does not enforce that previous stages succeed. This approach does not meet the requirement.

About these practice questions

Courseiva writes every AZ-400 question from scratch — 696 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official Microsoft exam blueprint

This AZ-400 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the AZ-400 exam.