AZ-400: Designing and Implementing Microsoft DevOps Solutions
Configure Activity Traceability and Flow of Work
Demo Repository Integration with Azure Boards
In this guide, you’ll learn how to integrate your code repositories with Azure Boards to link code changes directly to work items. This integration enhances traceability, centralizes change history, and improves team collaboration by automatically tracking commits on Azure Boards.
Overview
For this demonstration, we have an existing project in Azure Boards that includes a code repository for the "Customer Portal." The workflow involves selecting a task from the board, updating the code in the repository, and linking the update to the corresponding work item using Git commits. This process ensures that every commit is associated with a specific work item.
Navigating Azure Boards
Begin by opening Azure Boards and navigating to the Work Items section to see all active tasks. For example, the screenshot below displays a list of work items for the "Customer Portal" project:
In this scenario, we have a task (ID 69) that instructs us to add a sentence to the README file. The task ID is crucial since it helps link the commit to the corresponding work item in Azure Boards automatically.
Updating Your Code
- Open Visual Studio Code (or your preferred editor).
- Insert the required sentence in the README file to simulate a significant update or bug fix.
- Stage your changes in Git using the command below:
git add .
Tip
Remember, staging your changes properly ensures that all modifications are tracked before committing.
Committing Changes with Work Item Linking
When you commit your changes, include the work item identifier in the commit message using keywords like fix
, fixes
, or fixed
followed by a pound sign and the task ID. For example:
Added a sentence to README, fixes #69
No matter if you are using the command line, GitHub for Windows, or Visual Studio’s Git integration, this commit message format automatically links the commit to the corresponding work item. Once committed, push your changes to Azure Repos.
Verifying the Integration in Azure Boards
Head back to Azure Boards to review the work item. The development details will now display the commit information linked to the task. The following screenshot shows the repository view within Azure DevOps:
When inspecting task 69, you will see that the commit with your message is now attached to the work item. This linking mechanism helps managers and developers track progress and centralize the change history.
Best Practices for Commit Messages
Follow these practices to maximize the benefits of integrating Git with Azure Boards:
Best Practice | Description | Example |
---|---|---|
Include Work Item IDs | Always reference the work item number in your commit or pull request messages. | fixes #69 |
Write Descriptive Messages | Clearly describe what the commit accomplishes relative to the work item. | Added a sentence to README, fixes #69 |
Review Linked Items Regularly | Ensure all commits are correctly linked to work items to maintain project visibility. | N/A |
Maintain Consistency | Encourage your team to follow the same commit message format for easy tracking and history. | N/A |
Warning
If the commit links do not appear as expected in Azure Boards, verify that your connection settings, project configurations, and commit message formats (like "fixes #ID" or "AB#ID") are set up correctly.
Final Verification
To wrap up, the screenshot below shows the task board with the updated work item for the "Add a sentence to README" task. Notice the development section now includes detailed commit information:
This seamless integration between your code repository and Azure Boards simplifies bug tracking and project management by ensuring that every work item and commit is linked together effectively.
For more information on Azure Boards, check out the Azure DevOps Documentation.
Happy coding and efficient tracking!
Watch Video
Watch video content