Deploy your site to Azure from Github private repositories

Last June I attended Microsoft Tech Ed in Amsterdam. During the event the main focus in ASP.NET development was on Azure, the Microsoft cloud solution. I didn’t had the time yet to play around with Azure until I wanted to test if one of my personal projects would have mess speed/loading problems when deployed on Azure.


After working with Subversion (SVN) for the last years, the distributed source control of Github looked appealing. I didn’t wanted to give up the safety of my local SVN server at home with daily backups to my NAS. But on the other side, a recommended and proven source control like Github could only scale down backup and safety worries. To test out Github I’m now combining the two source control systems. Every change first gets committed to my SVN server and then committed and synchronized with my Github account.

Deploying to Azure

Azure websites have a few options to deploy to. Until some time ago the easiest way to deploy a website was to download the “publish profile” from the Azure management portal as shown in the image below


In Visual Studio you can select the downloaded “profile” and then publish to Azure.

Publish directly from Github

Scott Hanselman made a good post about deploying your application directly from your Github repository to your Azure website. Still working on Azure to test out the possibilities there was no problem that every commit would be deployed. It would give me the advantage to direct test the changes I made on my development machine in a ‘live’ production environment (although it isn’t the real production environment).

Following the steps as described by Scott I ran into a problem. When trying to associate my Azure website with the correct Github repository I could only choose from the existing public repositories. As my personal projects aren’t all open source projects I had placed this specific project in a private repository.

Searching for a solution

Up to Google to search if anyone else had solved this problem, maybe a setting on Github, maybe a setting in Azure, … I didn’t found any solutions on the GIT Deployment to Windows Azure forum nor on the wiki pages of the Kudu project (Kudu is the engine behind git deployments in Azure Web Sites. It can also run outside of Azure. It can be found on Github). I decided to post a comment on Scotts blog post. Scott was so kind to forward my question to David Ebbo who is working on Kudu with David Fowler. Just one hour after I posted my comment David responded on my question of it is already possible to deploy from private repo’s:

Not yet, but we are going to support this in the next update. Exact date is TBD, but hopefully in the next month or so.

No solution yet but …

One step closer, but no solution yet. I have some workarounds:

  • Make my repository public on Github.
  • Use the publish profile to deploy directly from Visual Studio
  • Look into pushing to Azure from a build server (not discussed in this post)

What I wanted to emphasize is the quick and clear response from Microsoft when dealing with this kind of problems. I can remember the long and tedious protocol to file bugs and then hopefully someone would answer a month or so later. The Microsoft of today is changed. Quicker response, listening to their users (the developers) and an improved open source protocol! A big change that hopefully will extend to all divisions at Microsoft.


For the people who have a MSDN subscription. There’s a basic start credit included in your MSDN subscription. If you want to start playing around in Windows Azure without waving a credit card from step 1.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.