Courseiva
Design and implement source controlhardMultiple ChoiceObjective-mapped

AZ-400 Design and implement source control Practice Question

Exhibit

Azure DevOps pipeline YAML snippet:
stages:
- stage: Build
  jobs:
  - job: BuildJob
    steps:
    - script: echo Building...
- stage: Deploy
  dependsOn: Build
  condition: eq(variables['Build.SourceBranch'], 'refs/heads/main')
  jobs:
  - job: DeployJob
    steps:
    - script: echo Deploying...

Refer to the exhibit. A developer runs the pipeline on a branch called 'feature/abc'. What will happen?

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

Only the Build stage will execute.

The 'Deploy' stage has a condition that checks if the source branch is 'refs/heads/main'. Since the branch is 'feature/abc', the condition evaluates to false, so the Deploy stage will be skipped. The Build stage runs regardless.

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 will fail with a syntax error.

    Why it's wrong here

    The pipeline will not fail with a syntax error because the YAML is structurally valid; stage conditions are evaluated at runtime, not during parsing, so a condition that evaluates to false does not cause a syntax failure. Azure Pipelines parses the YAML successfully and then evaluates each stage's condition before execution.

  • Only the Build stage will execute.

    Why this is correct

    Only the Build stage will execute because the Build stage has no condition (or an unconditional condition), so it runs on every branch. The Deploy stage has a condition that restricts it to the main branch (e.g., eq(variables['Build.SourceBranch'], 'refs/heads/main')), which evaluates to false on the o50p branch, causing the entire Deploy stage to be skipped.

  • Both stages will execute.

    Why it's wrong here

    Both stages will not execute because the Deploy stage's condition evaluates to false for the o50p branch. Azure Pipelines evaluates stage conditions before running any jobs in that stage; if the condition is false, the whole stage is skipped, so only the Build stage completes.

  • The Deploy stage will run but skip the steps.

    Why it's wrong here

    The Deploy stage will not run but skip its steps because a false stage condition causes the entire stage to be skipped, including all jobs and steps. The pipeline engine never enters the stage; it marks the stage as skipped and no steps inside are executed or even individually skipped.

About these practice questions

Courseiva writes every AZ-400 question from scratch — 823 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 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.