Courseiva
Design and implement build and release pipelinesmediumMultiple SelectObjective-mapped

Why an Environment and Approval Check Are Both Required for YAML Approvals

Which TWO conditions must be met to use multi-stage YAML pipelines with approvals?

Quick Answer

Multi-stage YAML approvals need two things in place: an environment resource created and configured with an approval check, and a deployment job that explicitly references that specific environment — the approval check is tied to the environment itself, so without both pieces the pipeline has nothing to gate against.

⚠ Common exam trap

A common mix-up: candidates think approvals are configured directly on the pipeline or stage in YAML, but they must be set on the environment resource and the deployment job must explicitly reference that environment.

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

An environment must be created and approval checks configured on it.

Multi-stage YAML pipelines in Azure DevOps require that an environment be created and approval checks configured on it to enable manual approvals. Additionally, the deployment job within the pipeline must reference a specific environment, as the approval check is associated with that environment resource. Without these two conditions, the pipeline cannot enforce approval gates before deployment.

Answer analysis

Option-by-option breakdown

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

  • The pipeline must be triggered by a pull request.

    Why it's wrong here

    Trigger type is irrelevant.

  • An environment must be created and approval checks configured on it.

    Why this is correct

    Approvals are set on environments.

  • The pipeline must have at least one stage defined in a separate release pipeline.

    Why it's wrong here

    Approvals are in the same YAML pipeline.

  • The deployment job must reference a specific environment.

    Why this is correct

    Deployment jobs target environments.

  • The pipeline must be created using the classic release editor.

    Why it's wrong here

    Approvals work with YAML pipelines.

About these practice questions

This AZ-400 question is part of Courseiva's 823-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Same concept, more angles

1 more way this is tested on AZ-400

These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.

Variation 1. You are setting up a release pipeline that deploys to multiple environments (dev, test, prod) sequentially. Each environment requires approval before deployment. What is the best way to implement this in Azure Pipelines?

easy
  • A.Define pipeline stages with environment resources and pre-deployment approvals.
  • B.Use environment resources with 'auto' trigger and no approvals.
  • C.Use classic release pipelines with approval gates per environment.
  • D.Use a custom PowerShell script to pause and prompt for approval.

Why A: Azure Pipelines supports multi-stage YAML pipelines where each stage can reference an environment resource. Pre-deployment approvals are configured on the environment itself, ensuring that before a stage deploys to that environment, the specified approvers must grant approval. This provides a native, auditable, and integrated approval gate without custom scripting or legacy tooling.

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

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.