AZ-400 Practice Question: Design and implement build and release pipelines
Your team uses Azure Repos for source control. You need to enforce that all builds must pass unit tests before code can be merged into the main branch. Which branch policy should you configure?
⚠ Common exam trap
It's easy for candidates to confuse build validation policies with other branch policies like required reviewers or work item linking, thinking they indirectly enforce quality, but only build validation directly enforces that unit tests pass before merge.
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 build validation policy that triggers the CI pipeline and requires it to succeed.
Azure Repos branch policies allow you to add a build validation policy that triggers a CI pipeline (e.g., a YAML or classic build pipeline) and requires it to succeed before a pull request can be completed. This ensures that all code merged into the main branch has passed unit tests, enforcing quality gates directly in the PR workflow.
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 build validation policy that triggers the CI pipeline and requires it to succeed.
Why this is correct
A build validation policy in Azure Repos branch policies attaches an automated pipeline to the PR as a required gate. When a PR is created or updated, Azure Pipelines runs the specified CI pipeline and posts a status back to the PR; the merge is blocked unless the policy reports a successful pipeline run. This directly enforces build integrity at the merge point, making it the correct way to ensure that code compiles and tests pass before it enters the target branch.
- ✗
Require a linked work item.
Why it's wrong here
Requiring a linked work item is a branch policy that enforces traceability between the PR and backlog items, but it does not execute or evaluate code. A PR can satisfy this policy while containing broken code, because the policy only verifies that a work-item ID exists in the commit, not that the build succeeds. This gate is purely administrative and has no direct connection to the CI pipeline status.
- ✗
Require a minimum number of reviewers.
Why it's wrong here
Requiring a minimum number of reviewers is a manual approval gate that ensures at least N users have explicitly approved the PR. However, reviewers are human and can approve without running the solution locally or verifying pipeline results; their approval is a subjective human signal, not an automated build outcome. Consequently, this policy cannot guarantee that the CI pipeline passed before merge, since it never invokes or inspects pipeline results.
- ✗
Require comment resolution.
Why it's wrong here
Requiring comment resolution ensures that all discussion threads on the code are marked as resolved before completion, which is a collaboration hygiene control. Marking a comment as resolved simply toggles its state in the PR UI; it does not trigger any pipeline execution or check for compiler errors, tests, or artifacts. Thus, a PR can have every comment resolved while the underlying code fails to build.
Go deeper
Related to this question
Learn chapter
Introduction to DevOps and Azure DevOps
Key term
Pull request
A pull request is a way for a developer to propose changes to a codebase and ask other team members to review and merge them into the main project.
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.