Contents

Creating ARM Templates was easier than I thought

Recently I have been getting my teeth into Infrastructure as Code (IAC) and particularly Azure Resource Manager (ARM) Templates. Initially, I saw these things as potentially large JSON files with a massive schema and something that could consume my time learning, causing me to question if I actually wanted to learn it. Although I am still very novice at ARM Templates and their full capabilities, I was very surprised at how easy they were to create and get going.

Use a Quickstart Template

Probably the easiest way to hit the ground running is to use the community contributed Quickstart Templates, which at the time of writing had 641 available. Each page gives you instructions on how to deploy with PowerShell or the Azure CLI and even gives a link to deploy via the Azure Portal. These are all available in GitHub, which also gives you further instructions on deployment.

Grab one you prepared earlier

In the Azure portal, you can manually create a Resource or a bunch of Resources in a Resource Group, then download a template from the Automation script link in the settings.

/media/2018/01/2018-01-18_14-27-02.png  

Create one from scratch in Visual Studio

The two methods above (especially the downloading of the script from the Azure Portal) give you a big file with a bunch of text, and you aren’t sure what is necessary or not. I prefer to start with an empty template and build up from there. Visual Studio is fantastic on this one. /media/2018/01/2018-01-18_15-08-00.png

/media/2018/01/2018-01-18_15-08-24.png

You can also install from the quickstart templates in this way as well.

This is super straightforward. Where the JSON you receive can be overwhelming, Visual Studio makes things easier to understand thanks to the JSON Outline.

/media/2018/01/2018-01-18_14-48-442.png

This makes viewing and understanding the structure of the template SO MUCH EASIER, and you add or delete resources with the click of a button.

/media/2018/01/2018-01-18_14-51-57.png

You don’t need to have made the template via Visual Studio, you can just open an existing template in VS and carry on.

Deploying an ARM Template

As I mentioned earlier, the Azure Quickstart Templates GitHub Repo has deployment methods documented, which is updated a lot more than this blog post will be. Additionally, this video below details how to deploy from within the Azure Portal. https://www.youtube.com/watch?v=h0UDIcRnPog I have been interested in the deployment of ARM Templates from a Azure DevOps Release pipeline, and am working on a post for that.