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
pr:
branches:
include:
- develop
```Refer to the exhibit. The YAML pipeline triggers on commits to main and develop branches, and pull requests targeting develop. A developer pushes a commit directly to main. What will happen?
⚠ Common exam trap
It's easy for candidates to assume a PR trigger fires for any branch change or that a push to main also triggers a PR evaluation, but PR triggers only respond to pull request events, not direct pushes.
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
✓
The pipeline runs once for the CI trigger.
The pipeline is configured with a CI trigger for both main and develop branches, and a PR trigger only for pull requests targeting develop. When a developer pushes a commit directly to main, the CI trigger fires because the push matches the main branch, causing the pipeline to run once. The PR trigger does not activate because there is no pull request involved.
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 does not run because the PR trigger requires a pull request.
Why it's wrong here
The PR trigger only evaluates builds for pull request validation, not direct push commits. Because the commit is pushed to main and no pull request is involved, the PR trigger never fires; however the CI trigger for main remains active, so the pipeline does run.
- ✓
The pipeline runs once for the CI trigger.
Why this is correct
The CI trigger explicitly includes the main branch, so a push to main immediately queues one pipeline run. Since this is a direct push and not a pull request, the PR trigger does not apply, resulting in exactly one build.
- ✗
The pipeline runs twice: once for the CI trigger and once for the PR trigger.
Why it's wrong here
The PR trigger fires only when a pull request is opened, updated, or re-targeted, never for a direct push to a branch. A commit pushed to main satisfies only the CI trigger, so the pipeline runs once, not twice.
- ✗
The pipeline runs once for the PR trigger only.
Why it's wrong here
A direct push to main is not a pull request event, so the PR trigger is never activated. The pipeline run originates solely from the CI trigger configured for main, not from the PR trigger.
Go deeper
Related to this question
Learn chapter
Designing a Build Pipeline
Key term
YAML pipeline
A YAML pipeline is a text-based file written in YAML format that defines an automated series of steps for building, testing, and deploying software in a continuous integration and continuous delivery (CI/CD) system.
Key term
Pipeline
A pipeline is an automated series of steps that takes code from development to production, ensuring quality and speed.
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 →
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.