How to Link Azure Boards with GitHub Commits and Pull Requests
Published Mar 14 2019 12:01 AM 11.1K Views

TL/DR: When using Azure Boards to track work items, these work items can be linked to GitHub commits and pull requests. When doing so, updates to the pull requests are also noted in the work item. Once the pull request has been merged, the Azure Boards work item automatically resolved. For detailed information, see the GitHub and Azure Boards documentation.


Quick and fun blog post with lots of pictures for today. The scenario is that my organization, let's call them Tailwind Traders, stores Azure Resource Manager Templates in GitHub and have a nightly Azure Pipelines build to lint and ensure proper configuration of these templates. Recently these builds started failing.




So, we are going to need to troubleshoot but first I will create an Azure Boards bug so that we can track the work.




Connect Azure Boards to GitHub


Before troubleshooting and potentially fixing the template issue. Let's link the Azure DevOps project to our GitHub repository. To do so, navigate to the project settings and select GitHub Connections and follow the on-screen prompts.


For more information on this operation, see Connect Azure Boards to GitHub




Fix template and create a pull request


Now that we have a. identified the issue and b. linked the Azure DevOps project with GitHub, we can begin to work the issue.


I am going to first move the work item from the new column to the Active column to signal to my team that I am working the issue. This also sets the state of the work item to Active.




Looking at the Azure Resource Manager template, I see that a simple comma is missing which has invalidated the template. I've added the comma and created a pull request for the fix. Take note here of the commit message. I've added to the message Fixes: AB#34. This string of text here will link this commit and PR to the Azure Boards work item.


For more information on this operation, see Link GitHub commits and pull requests to work items.




Because we have continuous integration and pull request validation enabled in our Azure DevOps project, I can see directly in the pull request that a build has been triggered to validate proper configuration of that Azure Resource Manager template.




I can also see the build in Azure DevOps itself.




What is really cool is that because I have created the link between my Azure DevOps project and GitHub and have used the correct strings in my commit message, all GitHub activity is now logged to the Azure Boards work item.




Merge pull request and close bug


Once the build has completed successfully, someone from my team will validate my work and merge the pull request. Because of the link between Azure Boards and GitHub account not only will the merge operation be logged to the Azure Boards work item:




the work item is also automatically is resolved.




That was super fun to work through. Feel free to reach out in comments or on Twitter @nepeters.

Version history
Last update:
‎Mar 23 2019 07:01 AM
Updated by: