AZ-400 Practice Question: Design and implement build and release pipelines
Exhibit
Refer to the exhibit.
```yaml
# azure-pipelines.yml
trigger:
branches:
include:
- main
- develop
stages:
- stage: Build
jobs:
- job: BuildJob
pool:
vmImage: ubuntu-latest
steps:
- script: echo "Building..."
- stage: Test
dependsOn: Build
condition: eq(variables['Build.SourceBranch'], 'refs/heads/develop')
jobs:
- job: TestJob
pool:
vmImage: ubuntu-latest
steps:
- script: echo "Testing..."
```Refer to the exhibit. A developer pushes a commit to the main branch. Which stages will run?
⚠ Common exam trap
Candidates often assume all stages in a pipeline run automatically after a commit, but stages can have independent trigger conditions or manual triggers that control whether they run in a given scenario.
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.
The exhibit shows that the Build stage has a trigger condition that matches the 'main' branch, and the Test stage does not have a trigger condition that is satisfied by the push (e.g., it is set to a different branch condition or to manual). Therefore, when a commit is pushed to main, only the Build stage is triggered automatically; the Test stage does not run.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Only the Test stage.
Why it's wrong here
The Build stage runs first because the push to main matches the trigger include, but the Test stage's condition evaluates to false for refs/heads/main, so Test is skipped. Thus, only the Test stage cannot be the result.
- ✓
Only the Build stage.
Why this is correct
The Build stage runs because main is included in the pipeline trigger, and the Test stage is skipped because its condition (e.g., checking for a non-main branch) is false for refs/heads/main. Therefore, only the Build stage executes.
- ✗
Neither stage.
Why it's wrong here
At least the Build stage runs because the push to main satisfies the branch trigger's include filter, so saying neither stage runs is incorrect.
- ✗
Both Build and Test stages.
Why it's wrong here
While the Build stage runs due to the main trigger, the Test stage does not execute because its condition explicitly fails for the main branch. Therefore, both stages running is not the outcome.
Go deeper
Related to this question
Learn chapter
Designing a Build Pipeline
Key term
Stage
A stage is a discrete phase in a software development or deployment pipeline where code is built, tested, integrated, or released in a controlled environment.
Key term
Branch
A branch is a pointer to a specific commit in a version control system that allows you to work on features or fixes in isolation from the main codebase.
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 →
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.