Automating code deployment with GitHub and Azure

There are many cloud services that support automated code deployment from GitHub. In this post, we’re going to be taking a look at connecting a GitHub repository to a Microsoft…

|
| 2 minutes

There are many cloud services that support automated code deployment from GitHub. In this post, we’re going to be taking a look at connecting a GitHub repository to a Microsoft Azure instance. When working with continuously delivered projects like web apps, this connection can be especially helpful for pushing out things like critical bug fixes; but it also removes barriers that might be keeping new features in a holding pattern on stale branches.

And you can set everything up in under 10 minutes.

Prerequisites

You’ll need a running web app instance on Azure before you get started. If you need help setting one up, there are quick video tutorials available in the Azure App Service documentation.

When your app is running, browse to its dashboard.

Your Dashboard

Step 1: Connect your App to its Repository on GitHub

In the All Settings menu on the right, choose the option to set up Continuous Deployment. Then click the Choose Source blade and choose GitHub.

GitHub may ask if you want to authorize Azure to have access to your accounts. It’s safe to click Authorize application.

Once authenticated, Azure will ask you which repository and which branch to deploy to your app.

Select your GitHub repository from the list and make sure you are deploying the master branch. Then click OK to finish up.

Choose a repository and branch

Azure will show you that your repository has been linked and will automatically begin deploying your code to your site.

When you see the green Active Deployment status, you’re all set.

Your Repository is Linked

Step 2: There is no Step 2

That’s it. If you browse to your app’s URL, you’ll see your app is now live on the Internet.

With everything connected, GitHub notifies Azure of any changes to the branch you specify (usually master) and Azure automatically deploys them for you. This means anytime you merge a Pull Request into master on GitHub, a single click delivers all of that new work to the people who use your app.

Merge a Pull Request

If you use Microsoft Azure to serve your app, this setup not only makes it easy to push out things like bug fixes; it also stimulates new development by removing barriers and helping you focus on shipping great code.

Additional Resources

Related posts