AZ-400 Question 69
Select 2Your company hosts its source code in Azure Repos. You are tasked with setting up a pull request workflow for the 'main' branch so that any changes must be reviewed by two team members and must pass a build validation pipeline before merging. Which two actions should you take to meet these requirements?
- A
Enable a minimum number of required reviewers and set it to '2' in branch policies.
- B
Allow project administrators to override branch policies if a full CI build has already run.
- C
Enable build validation for the 'main' branch and associate it with your CI pipeline.
- D
Grant all contributors permission to bypass policies and push directly to 'main'.
Show answer and explanation
Correct answers: A, C
Explanation
Azure DevOps branch policies allow you to enforce best practices such as requiring multiple reviewers and successful build validation before merging. Refer to the official Azure DevOps documentation on 'Branch policies' (https://learn.microsoft.com/azure/devops/repos/git/branch-policies) for detailed guidance on how to configure minimum reviewers and build validations. Disabling policy bypass for contributors is critical to maintaining an enforceable and consistent quality gate.
- A. Correct.
Correct. Enabling a minimum number of reviewers and setting it to 2 ensures that at least two distinct team members must approve changes before merging the pull request.
- B. Incorrect.
Incorrect. Allowing project administrators to override branch policies can undermine the established protections and does not ensure that all changes undergo the required checks.
- C. Correct.
Correct. Configuring a build verification policy ensures that the changes successfully pass the linked CI pipeline before the pull request can be merged.
- D. Incorrect.
Incorrect. Granting contributors the ability to bypass policies completely negates the purpose of requiring reviews and passing a build before merging.