{"id":38686,"date":"2020-03-23T13:28:09","date_gmt":"2020-03-23T20:28:09","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/premier-developer\/?p=38686"},"modified":"2020-03-27T08:38:56","modified_gmt":"2020-03-27T15:38:56","slug":"github-with-azure-devops","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/premier-developer\/github-with-azure-devops\/","title":{"rendered":"GitHub with Azure DevOps"},"content":{"rendered":"<p>This post is brought to you by <a href=\"https:\/\/www.linkedin.com\/in\/brian-blackman-8012b612\/\">Brian Blackman<\/a>, Principal Consultant with Microsoft Premier Developer, focusing on all things DevOps and Developer tools such Visual Studio and unit testing as well as <a href=\"https:\/\/www.linkedin.com\/in\/eldongormsen\/\">Eldon Gormsen<\/a>, Senior Consultant with Microsoft Premier Developer, focusing on all things DevOps and more such as containers.<\/p>\n<hr \/>\n<h2>An introduction to GitHub<\/h2>\n<p>GitHub has long been known as the home of the largest open source community in the world and it continues to grow. In 2018, open source developers made more than 1.1 billion updates to 96 million repositories on GitHub. GitHub\u2019s dominance in open source is the result of their intense focus on developers. Developers choose GitHub because it focuses on providing the best possible environment for building code, whether that\u2019s alone or together.<\/p>\n<p>GitHub allows hundreds, even thousands, of developers to contribute to the same code base without fear of losing or overwriting work. After seeing the successful projects being built in the open source communities, organization of all shapes and sizes took notice.<\/p>\n<p>Today, GitHub is meeting the demands of some of the most challenging business environments, including highly regulated industries like automotive and finance, to farming and medicine.<\/p>\n<h2>Why GitHub<\/h2>\n<p>GitHub is the home for developers across the world. While it is well known as the destination for open source collaboration, using GitHub as the place where your teams collaborate on private code for your enterprise has many advantages including:<\/p>\n<ul>\n<li>Familiar tooling<\/li>\n<li>Open source interoperability<\/li>\n<li>InnerSoure culture change<\/li>\n<li>Shift-left on Security<\/li>\n<\/ul>\n<h2>InnerSource with GitHub<\/h2>\n<p>GitHub brings premier social coding workflows to your organization by breaking down silos and enabling InnerSource. Where InnerSource is a method of developing software where engineers build their software using best practices from large-scale open source projects. Kubernetes and Microsoft\u2019s Visual Studio Code are two great examples of large successful open source projects that other teams can learn from.<\/p>\n<p>Advantages that GitHub brings to an InnerSource project are:<\/p>\n<ul>\n<li>Expertise sharing<\/li>\n<li>Cross-team collaboration<\/li>\n<li>Improved code reuse<\/li>\n<li>Increased velocity<\/li>\n<li>Secure workflows<\/li>\n<\/ul>\n<p><strong>In our next blog we will share with you using Azure DevOps for InnerSoure. Not all organizations will share their code externally, but they will internally.<\/strong><\/p>\n<h2>GitHub with Azure DevOps<\/h2>\n<p>GitHub combines open-source advantages with Azure DevOps enterprise-grade security.<\/p>\n<p>Implementing InnerSource through GitHub can increase teamwork, participation, and productivity\u2014while addressing enterprise-level <a href=\"https:\/\/github.com\/security\">security<\/a> and compliance needs that arise as processes become more open.<\/p>\n<p>Azure Pipelines can use GitHub repos as the source repository as shown in Figure 1.<\/p>\n<p><img decoding=\"async\" width=\"473\" height=\"457\" class=\"wp-image-38687\" src=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/03\/where-is-your-code-1.png\" alt=\"Where is your code?\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/03\/where-is-your-code-1.png 473w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/03\/where-is-your-code-1-300x290.png 300w\" sizes=\"(max-width: 473px) 100vw, 473px\" \/>\n<span style=\"font-size: 8pt;\">Figure 1: Where is your code?<\/span><\/p>\n<p>Note that this requires a GitHub service connection. If you have not already connected to GitHub you will be prompted to authorize the connection. Alternatively, you can create the connection in Project Settings using as shown in figure 3.<\/p>\n<p><img decoding=\"async\" width=\"707\" height=\"485\" class=\"wp-image-38688\" src=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/03\/create-a-connection-to-github.png\" alt=\"Create a connection to GitHub\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/03\/create-a-connection-to-github.png 707w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/03\/create-a-connection-to-github-300x206.png 300w\" sizes=\"(max-width: 707px) 100vw, 707px\" \/>\n<span style=\"font-size: 8pt;\">Figure 2: GitHub connections<\/span><\/p>\n<p>When creating a pipeline using the classic editor you need to select your location for your source code. Then when you select GitHub you need to authorize using OAuth or using a GitHub personal access token as shown in Figure 3.<\/p>\n<p><img decoding=\"async\" width=\"796\" height=\"536\" class=\"wp-image-38689\" src=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/03\/select-your-source-.png\" alt=\"Select your source.\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/03\/select-your-source-.png 796w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/03\/select-your-source--300x202.png 300w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/03\/select-your-source--768x517.png 768w\" sizes=\"(max-width: 796px) 100vw, 796px\" \/>\n<span style=\"font-size: 8pt;\">Figure 3: Select GitHub and Authorize<\/span><\/p>\n<h3>Grant access to your GitHub repositories<\/h3>\n<p>Grant Azure Pipelines access to your repositories to display them, trigger builds, and fetch code during builds. I currently have my pipelines setup using PAT for GitHub authentication.<\/p>\n<p>Authentication types for granting Azure Pipelines access<\/p>\n<table>\n<tbody>\n<tr>\n<td>Authentication type<\/td>\n<td>Builds run using<\/td>\n<\/tr>\n<tr>\n<td>1. <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/devops\/pipelines\/repos\/github?view=azure-devops&amp;tabs=yaml\">GitHub App<\/a><\/td>\n<td>The Azure Pipelines identity<\/td>\n<\/tr>\n<tr>\n<td>2. <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/devops\/pipelines\/repos\/github?view=azure-devops&amp;tabs=yaml\">OAuth<\/a><\/td>\n<td>Your personal GitHub identity<\/td>\n<\/tr>\n<tr>\n<td>3. <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/devops\/pipelines\/repos\/github?view=azure-devops&amp;tabs=yaml\">Personal access token (PAT)<\/a><\/td>\n<td>Your personal GitHub identity<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>In addition to using your GitHub repo in your pipeline we also have GitHub Release task to create, edit, or discard your <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/devops\/pipelines\/tasks\/utility\/github-release?view=azure-devops\">GitHub Release<\/a> from your pipeline. And a GitHub Comment task that enables the commenting of a PR or Issue in GitHub as shown in Figure 4.<\/p>\n<p><img decoding=\"async\" width=\"399\" height=\"499\" class=\"wp-image-38690\" src=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/03\/a-screenshot-of-a-cell-phone-description-automati.png\" alt=\"A screenshot of a cell phone Description automatically generated\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/03\/a-screenshot-of-a-cell-phone-description-automati.png 399w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/03\/a-screenshot-of-a-cell-phone-description-automati-240x300.png 240w\" sizes=\"(max-width: 399px) 100vw, 399px\" \/>\n<span style=\"font-size: 8pt;\">Figure 4: GitHub Comment Pipeline Task<\/span><\/p>\n<h2><\/h2>\n<h3>GitHub with Visual Studio<\/h3>\n<p>There a few ways to integrate your tooling with GitHub. First is integration with the Visual Studio IDE.<\/p>\n<p>The GitHub <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=GitHub.GitHubExtensionforVisualStudio\">marketplace extension<\/a>, see Figure 5, for Visual Studio facilitates connecting and working with GitHub repos from Visual Studio. The extension features connecting, cloning, creating, PRs, and more.<\/p>\n<p><img decoding=\"async\" width=\"667\" height=\"205\" class=\"wp-image-38691\" src=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/03\/github-visual-studio-extension.png\" alt=\"GitHub Visual Studio Extension\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/03\/github-visual-studio-extension.png 667w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/03\/github-visual-studio-extension-300x92.png 300w\" sizes=\"(max-width: 667px) 100vw, 667px\" \/>\n<span style=\"font-size: 8pt;\">Figure 5: GitHub Visual Studio Extension<\/span><\/p>\n<h3>GitHub with Visual Studio Code<\/h3>\n<p>GitHub also has in depth integration with VS Code also. There are many extensions GitHub extensions available. This one is a good one to start as most use cases are supported and there is a team at Microsoft\/GitHub supporting its development.<\/p>\n<h3><img decoding=\"async\" width=\"1231\" height=\"277\" class=\"wp-image-38692\" src=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/03\/word-image-27.png\" srcset=\"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/03\/word-image-27.png 1231w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/03\/word-image-27-300x68.png 300w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/03\/word-image-27-1024x230.png 1024w, https:\/\/devblogs.microsoft.com\/premier-developer\/wp-content\/uploads\/sites\/31\/2020\/03\/word-image-27-768x173.png 768w\" sizes=\"(max-width: 1231px) 100vw, 1231px\" \/><\/h3>\n<h3>Integrating with Azure Pipelines<\/h3>\n<p>Install Azure Pipelines from GitHub Market Place to enable integration with Azure Pipelines and GitHub. With this integration your builds are managed in Azure Pipelines. With this integration you can:<\/p>\n<ul>\n<li>Use build badge in your GitHub repo\u2019s README.MD file<\/li>\n<li>Unified Pipelines with YAML-defined CI\/CD<\/li>\n<li>Integrate Azure Pipeline with Azure Kubernetes Service<\/li>\n<li>Simplified Purchasing for Azure DevOps<\/li>\n<li>Active Directory Support for GitHub Enterprise<\/li>\n<li>Sign in to Azure and Azure DevOps with your GitHub account<\/li>\n<\/ul>\n<h3>Summary<\/h3>\n<p>With GitHub and Azure DevOps you have a powerful combination of tools to help you develop world class applications where you are an open source or enterprise developer. In future articles we will be exploring ways that you can integrate GitHub with Azure DevOps including Azure Pipelines and Azure Boards and InnerSource using Azure DevOps.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>With GitHub and Azure DevOps you have a powerful combination of tools to help you develop world class applications where you are an open source or enterprise developer.   <\/p>\n","protected":false},"author":582,"featured_media":38693,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[35,22],"tags":[2571,79,3],"class_list":["post-38686","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-alm","category-devops","tag-azure-devops","tag-github","tag-team"],"acf":[],"blog_post_summary":"<p>With GitHub and Azure DevOps you have a powerful combination of tools to help you develop world class applications where you are an open source or enterprise developer.   <\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts\/38686","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/users\/582"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/comments?post=38686"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts\/38686\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/media\/38693"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/media?parent=38686"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/categories?post=38686"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/tags?post=38686"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}