You are managing an Azure Repos Git repository. Developers frequently commit directly to the `main` branch, bypassing code reviews and breaking the build. You need to ensure that all changes to `main` are reviewed by at least two people and pass a successful automated build before being merged. What should you configure?

Direct Answer (Verified)Reviewed by Sunny (Senior Cloud Engineer)

Correct Answer: Branch policies on the 'main' branch enforcing 'Require a minimum number of reviewers' and 'Build validation'

Branch policies in Azure Repos protect important branches. By enabling 'Require a minimum number of reviewers' and 'Build validation', you force all changes to be made via Pull Req...

๐Ÿ“‹Part of Microsoft Certified: DevOps Engineer Expert (AZ-400) ยท Azure Certification Practice
Real Exam ScenarioAzure Repos

You are managing an Azure Repos Git repository. Developers frequently commit directly to the `main` branch, bypassing code reviews and breaking the build. You need to ensure that all changes to `main` are reviewed by at least two people and pass a successful automated build before being merged. What should you configure?

โœ“ Correct Answer & ExplanationAzure Repos

Correct Answer

Branch policies on the 'main' branch enforcing 'Require a minimum number of reviewers' and 'Build validation'

Why This Answer Is Correct

Branch policies in Azure Repos protect important branches. By enabling 'Require a minimum number of reviewers' and 'Build validation', you force all changes to be made via Pull Requests, ensure human oversight, and guarantee that the code compiles and passes tests before the PR can be completed and merged.

๐Ÿ“š What This Question Tests

This question evaluates your knowledge of Azure Repos โ€” a core concept tested in Microsoft Certified: DevOps Engineer Expert (AZ-400). Understanding Azure Repos is essential for designing scalable, secure, and cost-effective cloud architectures. Mastery of this topic will help you answer scenario-based questions confidently on exam day.