AZ-400 Branch policy Practice Question
Your organization needs to enforce that every commit to the main branch in Azure Repos is associated with a work item from Azure Boards. What should you configure?
⚠ Common exam trap
The trap is that candidates assume the 'Require a linked work item' branch policy applies to all pushes, but in Azure Repos it only applies to pull request completions. To enforce linked work items on every commit, you must first require pull requests for all changes to main.
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
✓
Configure a pull request policy that requires a linked work item, and enforce that all merges to main are via pull request.
In Azure Repos, the 'Require a linked work item' branch policy applies only to pull requests, not to direct pushes. To enforce that every commit to main is associated with a work item, you must require that all changes come through pull requests (via a branch policy requiring PRs) and then enable the 'Require a linked work item' policy on pull requests. This ensures that every commit merged into main via a PR has a linked work item. Option A is incorrect because the 'Require a linked work item' branch policy does not apply to direct pushes; it only applies to pull request completions.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Add a branch policy on main that requires a linked work item for all pushes.
Why it's wrong here
Incorrect because the 'Require a linked work item' branch policy in Azure Repos applies only to pull requests, not to direct pushes. It cannot enforce linked work items on commits pushed directly to main.
- ✗
Create a pre-receive hook in the repository to reject commits without a work item.
Why it's wrong here
Incorrect because Azure Repos does not support pre-receive hooks; that is a feature of GitHub and other Git platforms.
- ✗
Enable the 'Gated check-in' option in the branch policy for main.
Why it's wrong here
Incorrect because 'Gated check-in' is a legacy feature not supported in Azure Repos branch policies; it also doesn't enforce linked work items.
- ✓
Configure a pull request policy that requires a linked work item, and enforce that all merges to main are via pull request.
Why this is correct
Correct because by requiring all merges to main to be done via pull requests and enabling the 'Require a linked work item' policy on those pull requests, every commit to main will be associated with a work item.
Go deeper
Related to this question
Learn chapter
Introduction to DevOps and Azure DevOps
Key term
Pull request
A pull request is a way for a developer to propose changes to a codebase and ask other team members to review and merge them into the main project.
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
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.