Move Over Terraform, You’re Not The Only Code In Town!

It’s been a long standing “issue” and challenge with Azure Resource Manager (ARM) Templates. If you want to deploy an ARM template, you must already have a Resource Group created to deploy into.

Workarounds have included writing a PowerShell script, which pre-creates the Resource Group and then calling the ARM template deployment.

PowerShell command to create a new Azure Resource Group
PowerShell command to create a new Azure Resource Group
PowerShell command to deploy an Azure Resource Manager (ARM) template
PowerShell command to deploy an Azure Resource Manager (ARM) template

Other templating languages, like Terraform, didn’t have this issue; and you could create your new Resource Group AND deploy to it, all within the same template.

Terraform template that depects creating a new Resource Group, and deploying to it
Terraform template that depects creating a new Resource Group, and deploying to it

Today, that all changes! We now have the ability to create a new Resource Group in an ARM template, and then also deploy to that Resource Group!

ARM Template that depicts creation of a Resource Group, and deploying to it
ARM Template that depicts creation of a Resource Group, and deploying to it

A big thank you goes out to Kristian Nese for sharing the ARM template example on GitHub, which you can find here.

One thought on “Move Over Terraform, You’re Not The Only Code In Town!

  1. Jake

    How do you go about using New-AzureResourceGroupDeployment to deploy a RG, since you have to scope the command at a Resource Group?

Leave a Reply

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

%d bloggers like this: