Getting started with Azure Resource Management Templates | ARM templates

Fredrik Engseth
3 min readOct 10, 2021

Tried out Azure Resource Management templates this evening, to learn more about the “Infrastructure as Code” topic. A Resource Manager template is a JSON file that defines the resources to be deployed together through a declarative syntax. A templates can then be deployed via code. I started simple by creating a Resource Group in Azure first and then deployed a Storage Account with Azure PowerShell and an ARM template. This is what I did:

Used PowerShell for creating the resource group and to deploy the ARM template.

Started with logging into my Azure Portal with the following command:

Then created the script for creating a resource group.

When running the script, you will see something like this in the Azure Portal, under Resource Groups:

Also experimented with Tag creation when creating a Resource Group, by modifying the above script a bit. If you run the following script after you created the Resource Group above, it will only update the Resource Group with the added changes.

After running the script included with tag creation, you can click on the Resource Group name, iac-basic-arm. To take a look on the Overview pane. Below is the result after the first creation

Then the result after running the script with Tag creation. Just remember to refresh the page. If you don’t see it right away. You probably also click on Resource Groups in the breadcrumbs path, then then click on the iac-basic-arm group again, to see the updates. I worked for me.

Now, that the Resource Group is created, let’s look at the ARM template. To create this I used Visual Studio Code, I also installed the plugin Azure ARM Template Helper, to get help with writing the template.

What this does is to create an Azure Storage Account

To deploy the template you can run the following command:

When running the script, it may look something like this, if it runs successfully.

Now lets see what has changed in the Azure Portal. Heey! After refreshing the page you can see that the new Storage Account has been deployed successfully.

Cool to see what some cmdlets can do.

Originally published at https://www.fredrikengseth.com.

--

--

Fredrik Engseth

Developer | Dynamics 365 | Power Platform | Azure | Personal development | Investments | ☕ https://www.buymeacoffee.com/fredrikengseth