AZ-400 Design and implement source control Practice Question
Which TWO branch policies can be configured in Azure Repos to enforce code quality?
⚠ Common exam trap
Watch out — candidates often confuse 'comment requirements' with 'reviewer requirements' or assume 'work item linking' enforces quality, when in fact it only ensures traceability, not code quality.
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
✓
Status check
Status check (A) is correct because Azure Repos allows you to require that a status check passes before a pull request can be completed. This enforces code quality by integrating with external or built-in services (e.g., Azure Pipelines, SonarQube) that run automated tests, linting, or security scans. Build validation (C) is correct because it triggers a build pipeline automatically when a pull request is created, ensuring the code compiles and passes defined quality gates before merging.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Status check
Why this is correct
Status check is a valid branch policy in Azure Repos that requires an external service (e.g., SonarQube, Jenkins) to post a successful status to the PR before it can be completed. The policy defines a context name, and the service must report 'succeeded' via the Status API; otherwise, the PR is blocked. This enforces quality gates from CI/CD or analysis tools.
- ✗
Comment requirements
Why it's wrong here
Comment requirements are not a configurable branch policy in Azure Repos; they enforce that commit messages follow a specified regex pattern, not code quality or review processes. The existing note correctly identifies that this is about commit message formats, and since the question asks about branch policies that enforce quality, this option is incorrect.
- ✓
Build validation
Why this is correct
Build validation is a valid branch policy in Azure Repos that requires a designated build pipeline to run successfully against the merged result of the PR before it can be completed. It ensures the code compiles and passes automated tests, acting as a direct quality gate before merge. This is one of the two correct answers.
- ✗
Work item linking
Why it's wrong here
Work item linking is a branch policy that requires at least one work item to be associated with the PR, but it does not enforce code quality. The existing note correctly points out that it enforces linking to work items, not code quality, making it an incorrect choice for a quality-based policy.
- ✗
Merge strategy
Why it's wrong here
Merge strategy is not a quality-gating branch policy; it controls how commits are merged into the target branch (e.g., squash, rebase, merge commit). The existing note correctly states that it controls how merges are performed, not quality, so it is not one of the correct answers.
Go deeper
Related to this question
Learn chapter
Introduction to DevOps and Azure DevOps
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.
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
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.