Requiring Two Approvers and a Successful Build on the Release Branch
Your team uses Azure Repos with a Git branching strategy. You need to ensure that all changes to the release branch are reviewed by at least two approvers and that builds succeed before merging. Which TWO branch policy settings should you enable?
Quick Answer
Two branch policy settings cover both requirements: build validation blocks a merge unless the source branch compiles and passes its automated tests, and a minimum-reviewer count set to 2 requires that many distinct approvals before the pull request can complete. Together they enforce both 'builds must pass' and 'two reviewers required' without any custom tooling.
⚠ Common exam trap
A common mix-up: candidates confuse 'minimum number of reviewers' with 'required reviewers' or mistakenly think 'work item linking' or 'merge strategy' policies can enforce approval counts or build success, when in fact they address completely different concerns.
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
✓
Build validation
Build validation (A) ensures that a pull request cannot be merged unless the source branch compiles successfully and passes all configured automated tests, which directly enforces the requirement that builds succeed before merging. Minimum number of reviewers (C) set to 2 enforces the policy that at least two distinct approvers must approve the pull request before it can be completed. Together, these two settings satisfy both conditions: successful builds and two-reviewer approval.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Build validation
Why this is correct
Ensures builds succeed before merging.
- ✗
Work item linking
Why it's wrong here
Work item linking is a policy option but doesn't enforce approvals or build success.
- ✓
Minimum number of reviewers (set to 2)
Why this is correct
Ensures at least two approvals.
- ✗
Require a clean fast-forward merge
Why it's wrong here
This enforces linear history, not review requirements.
- ✗
Require a merge commit
Why it's wrong here
This is not a standard branch policy for review requirements.
Go deeper
Related to this question
Learn chapter
Introduction to DevOps and Azure DevOps
Key term
Git
Git is a version control system that tracks changes to files so multiple people can work on the same project without overwriting each other's work.
Key term
Branch policy
A branch policy is a set of rules and conditions enforced on a Git branch to control how code changes are proposed, reviewed, and merged, ensuring code quality and protecting critical branches.
About these practice questions
One of 823 original AZ-400 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
Same concept, more angles
5 more ways this is tested on AZ-400
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. 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?
medium- ✓ A.Add a build validation policy that triggers the CI pipeline and requires it to succeed.
- B.Require a linked work item.
- C.Require a minimum number of reviewers.
- D.Require comment resolution.
Why A: 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.
Variation 2. Your organization uses Azure Repos for source control and Azure Pipelines for CI/CD. You need to implement a policy that ensures every commit to the main branch is built and passes all tests before it can be merged. The team uses feature branches for development. What is the most efficient way to enforce this?
easy- A.Require developers to manually run the pipeline before merging.
- B.Use a pre-merge validation pipeline that runs on pull requests but does not block merging.
- ✓ C.Configure a branch policy on the main branch that requires a successful build from a pull request trigger.
- D.Set up a CI trigger on the main branch to run the pipeline on every commit.
Why C: Configuring a branch policy on the main branch that requires a successful build from a pull request trigger ensures that every commit to main must be built and pass tests before merging. This is the most efficient automated enforcement. Option A is incorrect because relying on manual builds does not enforce the policy automatically. Option B is incorrect because a pre-merge validation that does not block merging fails to prevent unvalidated commits. Option D is incorrect because a CI trigger on main runs after merge, not before, so it does not enforce pre-merge validation.
Variation 3. Your team uses Azure Repos Git and wants to enforce a policy that all pushes to the main branch must pass a build validation pipeline. The pipeline runs unit tests and code analysis. You need to configure this in the branch policy. Which setting should you enable?
easy- A.Require comment resolution
- B.Linked work items
- C.Limit merge types
- ✓ D.Build validation
Why D: The Build validation policy in Azure Repos Git enforces that a specified pipeline must succeed before a pull request can be merged into the target branch. This directly meets the requirement to run unit tests and code analysis on all pushes to the main branch, blocking merges if the build fails.
Variation 4. A development team uses Git for source control. They want to enforce a branching strategy where all feature work is done in short-lived branches that are merged to main via pull requests. The team also requires that every commit on main builds successfully. Which TWO practices should the team implement?
medium- ✓ A.Configure a branch policy on main that requires a successful build before merging.
- B.Use squash merge when completing pull requests to main.
- ✓ C.Require at least one approver on all pull requests targeting main.
- D.Create feature branches from main and keep them long-lived for stability.
- E.Allow developers to commit directly to main for urgent fixes.
Why A: Option A configures a branch policy on main that requires a successful build before merging, directly ensuring every commit on main has passed a build. Option C requires at least one approver on all pull requests targeting main, which enforces the code review process as part of the pull request workflow, a key practice for maintaining a healthy branching strategy with short-lived feature branches. Together, these two practices enforce both the build-success requirement and the pull-request-based workflow.
Variation 5. Your organization uses GitHub for source control and Azure Pipelines for CI/CD. You need to implement a policy that requires all pull requests to be built and pass tests before merging. What should you do?
medium- ✓ A.Add a branch protection rule in the GitHub repository requiring status checks.
- B.Set the pipeline trigger to run on pull request.
- C.Configure pipeline permissions to require approval.
- D.Add a pre-deployment check on the environment.
Why A: GitHub branch protection rules allow you to require status checks to pass before merging a pull request. By configuring a rule that requires the Azure Pipelines build and test status check to succeed, you enforce that all pull requests are validated before they can be merged into the protected branch.
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.