Git Repository Gets Better with Deploy to Azure Button

Developers will be able to easily deploy their apps to Azure websites from a Git repository with the help of Deploy to Azure Button. In order to work with this new feature, you just need to place the button in your README.md file with a link to https://azuredeploy.net/. If a user click on the button they will be automatically redirected to a streamlined deployment process.

Deploy to Azure Button

In order to add a Deploy to Azure button, you need to insert the following piece of code

<a href="https://azuredeploy.net/" target="_blank">
    <img src="http://azuredeploy.net/deploybutton.png"/>
</a>

You can also add a text link instead of image with the phrase “Deploy to Azure”. The readme file supports standard HTML tags.  As you can see, the above HTML code enable to website to open in a new window due to target attribute.

Let us now examine the background process involved in the above feature. A referrer header is sent to azuredeploy.net, which contains the location of the Git repository to deploy from.

In order to host the button somewhere outside of your Git repository, you can specify a query string in the target URL like so

<a href="https://azuredeploy.net/?repository=https://github.com/user/repo" target="_blank">
    <img src="http://azuredeploy.net/deploybutton.png"/>
</a>

As a developer, you can also create a custom ARM template by adding a file called “azuredeploy.json” to the root of your repository.

Adding an app setting to your site
Installing JabbR with a SQL Azure database dependency

You can download the complete set of files used for Azure deployment on the GitHub project site.

Elliott Hamai, Software Engineer, Azure Websites has created a demo video which examines the whole process involved with Deploy to Azure Button.

READ  Introducing ASP.NET

Developers have strated to post comments and questions about Deploy to Azure Button on the official blog post.

Patrick – Is there a way to control which branch is deployed?

Elliott Hamai – The branch is specified by the Git URL that is referred to azuredeploy.net, and will automatically be picked up. That being said, there is currently an issue with the Azure Websites back-end at the moment which will cause it to always deploy from the “master” branch. However a fix for that will be out very soon.

suwatch

Nice work! I did try it on https://github.com/suwatch/ARM… repository and it works as advertised.

Trevor Sullivan, Microsoft MVP, PowerShell:

One word: awesome

Leave a Reply

Your email address will not be published.