AZ-400 Question 3
Select 2You are designing a solution in Azure DevOps for a cross-functional team. The team frequently commits and merges changes without linking them to the relevant work items, causing confusion about which user stories or bugs have been addressed. You want to enforce traceability so that every pull request references at least one relevant Azure Boards work item, and to streamline the flow of work from backlog item creation through deployment. Which two actions should you take to accomplish this goal?
- A
Enable the 'Require a linked work item' branch policy in Azure Repos to prevent merges when no work items are linked.
- B
Configure the build validation policy so that the branch cannot be merged unless the build is successful.
- C
Use the '#
' mention in commit messages or pull request titles to automatically link commits to their respective work items. - D
Apply a manual code review policy requiring at least two reviewers to check code quality and best practices.
- E
Disable the auto-complete feature on pull requests to force developers to finalize merges manually.
Show answer and explanation
Correct answers: A, C
Explanation
To maintain traceability in Azure DevOps, you can enforce policies that require all code changes be associated with the relevant work items. The 'Require a linked work item' branch policy prevents merges lacking a linked work item, and using the '#
- A. Correct.
Option 1 is correct. Enabling the 'Require a linked work item' policy in Azure Repos ensures that a pull request cannot be merged unless at least one work item is linked, thereby enforcing traceability and preventing unassociated changes.
- B. Incorrect.
Option 2 is incorrect. While a build validation policy helps maintain code quality by ensuring builds pass before merging, it does not require or enforce linking changes to work items, so it does not solve the traceability issue.
- C. Correct.
Option 3 is correct. Using the '#
' mention in commits or pull requests automatically creates links to the appropriate work items in Azure Boards. This approach streamlines traceability without requiring manual linking each time. - D. Incorrect.
Option 4 is incorrect. A manual code review policy can improve the quality of the code, but it does not specifically enforce linking changes to work items. It addresses best practices in code review, not traceability.
- E. Incorrect.
Option 5 is incorrect. Disabling the auto-complete feature may slow down merges and encourage manual oversight, but it does not inherently enforce linking to a work item. There is no mechanism in this setting that ties code changes to work items.