Azure Resource Management Templates

by DotNetNerd 29. March 2016 12:59

image11A core value that Azure brings to modern projects, is to enable developers to take control of the deployment process, and make it fast and painless. Sure scalability is nice, when and if you need it, but the speed and flexibility in setting up an entire environment for your application is always valuable - so for me this is a more important feature of Azure. Gone are the days of waiting at best days, most likely weeks and maybe even months for the IT department to create a new development or test environment.

Starting out with ARM templates

With Azure Resource Management Templates the developers control of the resources becomes even more powerfull. The technology allows you to describe all the services that your application needs, so you can deploy them to a resource group or make updates to services that are already running. An ARM template is simply json, with expressions and functions, that allow them to be dynamic. The templates may seem a bit scary at first glance, but the quick start templates on github will most likely provide you with a good starting point, so it is pretty easy to get off the ground. In my case I needed a webapp, with a documentdb database and storage. The template for a documentdb-webapp was already there, so all I needed was to merge it with one that showed how to setup storage. This was far simpler than I first expected, and within an hour or two I was spawning complete development environments with connectionstrings, config settings and so on in place. Another way to get started is to export templates from the portal, which a menu item on each resource, and then merge or build on those.

Choose your tooling

Working with the templates is quite doable in a regular text editor, but when you install the Azure SDK for VS 2015 you will also get a project type for Visual Studio, that will give you a nice tree view of the template, as well as allow you to deploy directly from Visual Studio. Personally I really like being able to deploy directly from the commandline, and out of the box I get the option to do this either using Powershell or the xPlat CLI. To be honest, the Powershell tooling is a bit smoother, so even though I have a preference for the xPlat CLI I tend to use both interchangeably. I still use the project type in Visual Studio, because it helps a bit with authoring, and having templates be part of the project as any other version controlled artifact is really nice.

I highly recommend giving ARM templates a shot. The learning curve is not bad, and the power and flexibility you gain is amazing.

Who am I?

My name is Christian Holm Diget, and I work as an independent consultant, in Denmark, where I write code, give advice on architecture and help with training. On the side I get to do a bit of speaking and help with miscellaneous community events.

Some of my primary focus areas are code quality, programming languages and using new technologies to provide value.

Microsoft Certified Professional Developer

Microsoft Most Valuable Professional

Month List