Azure GitHub is a powerful tool that enables developers to manage their code repositories and collaborate with teams in the cloud. It's a game-changer for cloud development.
With Azure GitHub, you can create and manage multiple repositories, each with its own set of permissions and access controls. This allows you to keep your code organized and secure.
One of the key benefits of Azure GitHub is its seamless integration with Azure DevOps, allowing you to automate your development workflow and streamline your project management. This integration enables you to track changes, manage builds, and deploy your code to production with ease.
Azure GitHub also offers advanced security features, including two-factor authentication and granular permissions, to protect your code and data from unauthorized access.
Connecting to Azure GitHub
Connecting to Azure GitHub is a straightforward process. You can connect up to 500 GitHub repositories to an Azure Boards project.
To start, sign in to your project and select Project settings > GitHub connections. If this is your first time connecting from the project, select Connect your GitHub account to use your GitHub account credentials.
You can also add a GitHub connection with GitHub credentials by signing in using your GitHub credentials and selecting the GitHub account or organization you want to connect.
To connect using a Personal Access Token (PAT), choose Personal Access Token and enter the PAT and select Connect. Make sure to include the required scopes: repo, read:user, user:email, admin:repo_hook.
If you're connecting to a GitHub Enterprise Server, ensure your server is accessible from the Internet and verify that Azure DNS can resolve your server name. You'll need to select the authentication method and enter the necessary credentials.
The Azure Boards-GitHub integration uses various authentication protocols to maintain the connection. Changes to a user's permission scope or authentication credentials can revoke the GitHub repositories connected to Azure Boards.
Here are the steps to resolve connection issues:
- Remove and re-create the connection to the GitHub Enterprise Server repository
- Fix the webhook URL by editing the webhook URL in GitHub's repository settings page and pointing it to the migrated Azure DevOps organization URL
Troubleshooting and Maintenance
To maintain a smooth connection between Azure Boards and GitHub, it's essential to be aware of the authentication protocols used. Azure Boards uses various authentication protocols to maintain the connection.
Changes to a user's permission scope or authentication credentials can revoke the GitHub repositories connected to Azure Boards. This can be frustrating, but knowing the cause helps you take corrective action.
Azure Boards integrates with GitHub.com and GitHub Enterprise Server repositories, but only Azure DevOps Server 2019 and later versions support integration with GitHub Enterprise Server repositories. Other Git repositories are not supported.
Integration with GitHub Enterprise Server repositories requires Azure DevOps Server 2019 or later versions. This ensures a seamless connection and optimal performance.
Workflows and Automation
GitHub Actions for Azure is a powerful tool that allows you to automate software development workflows. You can find all the GitHub Actions for Azure in the GitHub Marketplace.
Microsoft developed GitHub Actions for Azure to be used with Azure, making it a seamless integration. The Azure starter action workflows repository includes end-to-end workflows to build and deploy Web apps of any language, any ecosystem to Azure.
You can see complete workflow examples in the Azure starter action workflows repository. This repository is a great resource for learning how to build and deploy Web apps on Azure.
Azure Pipelines and GitHub Actions both help you automate software development workflows, but they have some key differences. You can learn more about how the services differ and how to migrate from Azure Pipelines to GitHub Actions.
With Azure Pipelines, you can create Continuous Integration in a declarative way using YAML documents. This allows development teams to leverage the same YAML documents to build multi-stage pipelines-as-code for both Continuous Integration and Continuous Delivery.
Azure Pipelines can now be easily integrated with Kubernetes clusters, making it simple to collaborate around CI/CD pipelines. You can connect to Azure Kubernetes Service with only a few clicks, or connect to Kubernetes running on-premises or on any public cloud.
Actions and Pipelines
Azure GitHub offers two services to automate software development workflows: Azure Pipelines and GitHub Actions. Both help streamline development processes, but they differ in their approach and capabilities.
Azure Pipelines is a core part of Azure DevOps, allowing for the creation of Continuous Integration in a declarative way using YAML documents. This enables development teams to leverage the same YAML documents to build multi-stage pipelines-as-code for both Continuous Integration and Continuous Delivery.
GitHub Actions, on the other hand, can be used to connect to Azure from GitHub, depending on the action. You can use a service principal or publish profile to connect to Azure, and the Azure login action supports using a publish profile or service principal.
Here are some available GitHub Actions for Azure:
- Azure Spring Cloud
- Deploy Bicep file or Azure Resource Manager template
- Deploy to a static web app
- Azure App Service settings
- Deploy to Azure Functions
- Deploy to Azure Functions for Containers
- Docker login
- Deploy to Azure Container Instances
- Container scanning action
- Kubectl tool installer
- Kubernetes set context
- AKS set context
- Kubernetes create secret
- Kubernetes deploy
- Setup Helm
- Kubernetes bake
- Build Azure virtual machine images
- Machine learning login
- Machine learning training
- Machine learning - deploy model
- Deploy to Azure SQL database
- Deploy to Azure MySQL action
- Azure Policy Compliance Scan
- Manage Azure Policy
- Trigger an Azure Pipelines run
Update XML Definitions for Select Work Items
If your organization uses the Hosted XML or on-premises XML process model, you'll need to update the XML definitions for select work item types to customize the work tracking experience.
To link user stories and bugs to GitHub commits and pull requests, update the XML definitions for user stories and bugs. This is necessary for the Development section in the work item forms to display the link types.
Follow the sequence of tasks provided in the Hosted XML process model to update the XML definitions. For each work item type, find the Group Label="Development" section.
Add the following two lines in the code syntax to support the external link types: GitHub Commit and GitHub Pull Request. This will enable linking to and viewing GitHub link types from the Development section in the work item forms.
Actions vs Pipelines
Azure Pipelines and GitHub Actions both help automate software development workflows.
GitHub Actions and Azure Pipelines differ in their approach. Azure Pipelines use YAML documents to create workflows, while GitHub Actions is a service that allows you to automate your software development workflow directly within GitHub.
Azure Pipelines can be used to create multi-stage pipelines-as-code for both Continuous Integration and Continuous Delivery using YAML documents. This feature was a big request from customers.
You can leverage the same YAML documents to build deployment pipelines with Azure Pipelines, and store them in source control. This helps drive a tighter feedback loop between development and operation teams.
Action Requirements
To get started with GitHub Actions for Azure, you'll need to have both an Azure and a GitHub account. An active Azure subscription is required, which you can create for free if you don't already have one.
To connect GitHub Actions and Azure, you'll need to use either a service principal or a publish profile. A service principal is required when using the Azure login action.
You can use a service principal in combination with OpenID Connect or a secret. Alternatively, you can use a publish profile with the Azure App Service action.
Here are the specific requirements for connecting GitHub Actions and Azure:
The Azure login action can be used in combination with both the Azure CLI and Azure Azure PowerShell actions.
Unified Pipelines with YAML CI/CD
Unified Pipelines with YAML CI/CD is a game-changer for development teams. It allows for the creation of Continuous Integration in a declarative way using YAML documents.
With Azure Pipelines, you can now leverage the same YAML documents to build multi-stage pipelines-as-code for both Continuous Integration and Continuous Delivery. This was one of the biggest requests from customers.
Azure Pipelines analyzes your repository and suggests the right set of YAML templates to configure your pipeline and all the required Kubernetes manifest files for deploying to the cluster. This makes it easy to integrate with Kubernetes clusters.
Here's a list of some of the benefits of Unified Pipelines with YAML CI/CD:
- Tighter feedback loop between development and operation teams
- Clear, readable documents for pipeline configuration
- Easy integration with Kubernetes clusters
By using YAML-defined CI/CD, you can drive a more efficient and streamlined development process. This is especially useful for teams that need to collaborate around CI/CD pipelines.
Azure Pipelines also provides rich information on pod details, such as logs, container images, and image detail view. This is a huge improvement for diagnostics and troubleshooting.
Project Management
You can manage your GitHub projects with Azure DevOps by creating user stories and tasks to define how a story is to be implemented. In Azure DevOps, you can navigate to Boards | Backlogs and click New Work Item to add a user story with a title like "User can select airport by city".
To link GitHub issues to work items in Azure Boards, you can choose the Links tab and select Add Link -> Existing item. This allows you to manually connect a GitHub Commit or a pull request by selecting Add Link under the Development section.
Azure Boards performs a check to ensure that you've entered a valid link, and then the commit will appear under the Development section as shown below.
Managing Projects
Managing Projects can be a daunting task, but with the right tools and strategies, it can become more manageable. You can start by using a project management tool like Azure DevOps, which allows you to create and manage work items, such as user stories and tasks.
To create a new work item, you can click on the "New Work Item" button in the Azure DevOps tab. This will allow you to add a user story with a title, such as "User can select airport by city." You can then press Enter to create the work item.
A Kanban board is a flexible option for managing work items, allowing you to edit items on a card in line or drag cards around to change their state and assignment. To take ownership of a new user story, you can add it to the Active column by dragging it there.
Assigning a task ID to a work item is an important step in tracking progress. You can make note of the task ID for reference later during a future commit and pull request.
Here are some key steps to follow when managing projects with Azure DevOps:
Configure Boards App
You can install the Azure Boards app on GitHub Marketplace, which simplifies the installation process and configuration of your GitHub repository connections.
To install it, navigate to the Azure Boards page on GitHub and choose Set up a plan.
Azure Boards offers free licenses for you to start, with the first five users for private repositories and many more for public repos.
Select Install it for free to begin the installation process.
Here are the steps to configure the Azure Boards app:
- Select the repositories you want to connect to Azure Boards (or all repositories) and click Install.
- Select the Azure DevOps organization and Azure Boards project you want to connect to GitHub.com.
- Authorize your Azure Boards organization to connect with GitHub.com.
- If you have selected All repositories, you will need to confirm the GitHub repositories that you want to use with Azure Boards project to complete the integration.
Frequently Asked Questions
What is the Azure equivalent of GitHub?
Azure DevOps is a platform for planning, collaborating, and deploying code, similar to GitHub. It's a popular choice for enterprises and cloud initiatives due to its robust features and scalability.
Is Azure DevOps being replaced by GitHub?
Azure DevOps and GitHub are complementary platforms, not replacements, as they both utilize Git and offer robust version control capabilities. They cater to different needs, with Azure DevOps focusing on DevOps and GitHub on software development.
Does GitHub run on AWS or Azure?
GitHub hosts its runners on virtual machines in Microsoft Azure, not Amazon Web Services (AWS). Specifically, they use Microsoft Azure with the GitHub Actions runner application installed.
Sources
- https://learn.microsoft.com/en-us/azure/devops/boards/github/connect-to-github
- https://learn.microsoft.com/en-us/azure/developer/github/github-actions
- https://www.azuredevopslabs.com/labs/vstsextend/github-azureboards/
- https://azure.microsoft.com/en-us/blog/accelerating-devops-with-github-and-azure/
- https://azure.github.io/azure-sdk/
Featured Images: pexels.com