Back in July 2012 Microsoft announced improvements to Azure Web Sites. One of those improvements was to Git publishing so when you pushed changes to your Github repository Azure would automatically pick that up and deploy the project. I even mentioned it in my DinnerParty blog post but have only just looked at implementing it.
As I said in my previous post Azure supported Git publishing but it was a two step process. You push to Github and then push to Azure and it gets deployed. If you already have Git setup on your Azure account there is nowhere in the dashboard that allows to you setup Github integration. I thought I was going to have reset my deployment credentials and set it all up again when I asked the question on Jabbr. Luckily David Fowler was online. Why is that lucky? He wrote the Github integration feature of Azure.
To setup your Azure account to enable Github integration you have to FTP into your Azure account and delete the deployment history by deleting all contents in the /site/deployments folder.
Once the history is deleted, if you go to the Deployments tab in the Azure account you will now see a link to “Deploy from my GitHub repository”.
By clicking the link it will inform you that you need to authorize Azure to have access to your Github repository and that if there is code already in your repository it will be deployed again.
Once you authorize Azure to read your Github account you need to tell it which repository it should watch.
As stated earlier, if there is code in the repo it will begin to deploy automatically and confirm deployment once this has been done.
From now on, once you push changes to your Github repository Azure will pick them up and deploy the project to your web site! Could it get any easier?
UPDATE 7th Nov 2012: After speaking to David Fowler again he remembered that you could take the Git webservice hook and enter that into the Github repository account settings.
Go to the Configure tab in Azure and copy the Git hoook URL.
Then go to your Github repo and into the Admin section and under Service Hooks enter the copied Azure URL
Away you go!