Do New Commits Reset Pull Request Approvals? It Depends on resetOnPush
Your team uses Azure DevOps with a Git repository. You want to enforce that all pull requests to main must have at least one reviewer from the 'security' group. Which two configurations are required? (Choose two.)
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 the security group as a required reviewer for the main branch policy.
You can add the security group as a required reviewer in the branch policy. Option D is correct because setting the minimum number of reviewers to 1 ensures at least one reviewer is required. Option A is incorrect because automatic reviewers are not the same as required reviewers; they only suggest reviewers but do not enforce mandatory review. Option C is incorrect because a repository policy applies to all branches, not just main, and does not enforce required reviewers for pull requests; a branch policy is needed. Option E is incorrect because a branch protection rule is a GitHub feature, not available in Azure Repos.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Configure automatic reviewers for the security group.
Why it's wrong here
Automatic reviewers in Azure DevOps add reviewer names to a pull request based on path rules, but they function as suggestions and do not block completion. They are not mandatory reviewers; the PR can be merged even if the auto-added security-group member has not approved. To enforce a mandatory security review, the group must be added as a required reviewer in the branch policy, not just configured for automatic inclusion. Therefore automatic reviewers are insufficient for the requirement.
- ✓
Add the security group as a required reviewer for the main branch policy.
Why this is correct
Adding the security group as a required reviewer in the Azure DevOps branch policy for main is the correct approach. This policy blocks pull request completion until a member of that group approves, making the security review a hard condition. The policy can also specify 'Required' reviewers, which prevents the PR from being completed without the mandated approval. This is the standard, declarative way to enforce that a specific team always signs off on merges to the main branch.
- ✗
Create a repository policy for the main branch.
Why it's wrong here
Creating a repository-level policy in Azure DevOps would apply settings to all branches under that Git repository, not just main. Repository policies are designed as defaults for the entire repo, whereas a branch policy on main lets you enforce main-specific requirements like a required security-group reviewer. The requirement is branch-scoped, so the correct target is the branch policy for main, not a repo-wide policy. In fact, repo-wide policies cannot be scoped to a single branch in the Azure DevOps UI.
- ✓
Set the minimum number of reviewers to 1 in the branch policy.
Why this is correct
Setting the minimum number of reviewers to 1 only requires any single user to approve; it does not specify that the approver must belong to the security group. The requirement demands a member of the security group must approve, which is a specific, named reviewer requirement. To satisfy it you need a required-reviewer policy that names the security group, not merely a generic count of approvals. This option addresses quantity of approvals rather than identity.
- ✗
Configure a branch protection rule in GitHub.
Why it's wrong here
Branch protection rules are a GitHub feature and apply only to repositories hosted on GitHub. Since your team uses Azure DevOps Git repositories, you would use Azure DevOps branch policies instead. Configuring a rule in GitHub would have no effect on the Azure DevOps repo, and the Azure DevOps branch policy UI is where required reviewers are set. This option confuses the equivalent features of two different platforms.
Go deeper
Related to this question
Learn chapter
Final Review and Exam Preparation
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
Repository
A repository is a central storage location where software packages, code, or configuration files are kept, managed, and distributed for use by IT systems.
About these practice questions
This AZ-400 question is part of Courseiva's 696-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 →
Same concept, more angles
3 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. You have the above branch policy configuration for the main branch. A developer pushes a new commit to an existing pull request. What happens?
hard- A.The existing approvals are reset, but no new build is queued.
- B.The pull request is automatically completed.
- ✓ C.The existing approvals are reset, and a new build is automatically queued.
- D.The existing approvals remain valid, and the build is not requeued.
Why C: When a new commit is pushed to an existing pull request and the branch policy includes a build validation with 'Reset approvals on new changes' enabled, Azure DevOps resets all existing approvals and automatically queues a new build to validate the updated code. This ensures that approvals are only valid for the exact code revision that was reviewed. The behavior is standard for branch policies that require a build and have the reset option configured.
Variation 2. You are reviewing the branch protection policy for the main branch in an Azure DevOps repository. Based on the exhibit, what happens when a stale review exists on a pull request after new changes are pushed?
medium- A.Admins are exempt from the review requirement
- ✓ B.The stale review is automatically dismissed, and the PR requires new approvals
- C.The PR still requires only 2 approvals, but stale reviews are not dismissed
- D.The PR can be merged even without the required reviews
Why B: The branch protection policy for the main branch has 'Reset code reviewer votes when there are new changes' enabled. When a stale review exists after new changes are pushed, Azure DevOps automatically dismisses the previous approval(s) and requires new approvals to meet the minimum number of reviewers (2). This ensures that reviewers re-evaluate the latest code changes before the pull request can be merged.
Variation 3. Refer to the exhibit. A developer pushes a new commit to an existing pull request targeting the main branch. What is the effect on the pull request?
medium- A.The pull request is automatically merged.
- B.The existing approvals remain valid, and no re-review is needed.
- ✓ C.All existing approvals are revoked, and the pull request must be re-approved.
- D.The new commit is rejected because it was pushed without a code review.
Why C: The policy 'Reset code reviewer votes when new changes are pushed' is set to true. Therefore, when a new commit is pushed, all previous reviewer votes are reset. The required number of reviewers is 2, but minimum is 1, so at least one reviewer must approve again.
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.