Blog Post

Apps on Azure Blog
3 MIN READ

Learn ARM templates (4 tutorials), from the beginning

Chris_Noring's avatar
Chris_Noring
Icon for Microsoft rankMicrosoft
Oct 21, 2020

Infrastructure as Code

Infrastructure as Code, IaC is the process of expressing your infrastructure as Code as readable text files over using UIs to configure the same. The benefits of doing so are many. Below are some benefits:

  • Dev and Ops can work in the same process. There's a need for Developers and Ops to work more tightly to innovate faster with speed and accuracy. Developers normally store their code in a version control system like Git. You can now do the same with your templates, text files desribing your Cloud resources.
  • Anyone can deploy. When your templates are in version control, anyone on the team can deploy, just use a tool like Azure-CLI or PowerShell to do so. When everyone in a team can deploy it's important that it can be done reliably.
  • You know what's in the Cloud. Before IaC you were/are using a graphical interface or some tool to manage your resources. It's easy to loose track of what you have in the Cloud. If you instead express your resources as text files it's a lot easier to see what's going on.
  • Easier to reproduce elsewhere. In theory at least, it should be a lot easier to recreate your Cloud operation elsewhere if you are looking to expand your company's business elsewhere.

 Azure Resource Manager

Azure Resource Manager, ARM, is one of the ways you can use to implement IaC, the other way is by using Terraform. The idea is to express your cloud resources as JSON files. Then you deploy the files to the Cloud by running either Azure-CLI or PowerShell. Every JSON file is known as a template. A template contains your resources you want to deploy but it also contains different constructs that makes it easy to manage your resources as things gets more complicated. Examples of such constructs are parameters, variables, template functions and outputs.

LEARN path

IaC using ARM is quite a big topic. Therefore myself and some colleagues have authored a 4 part series describing the various constructs and aspects of it.

Here's a link to the path, an overview page for all the tutorials

https://docs.microsoft.com/en-us/learn/paths/deploy-manage-resource-manager-templates/

Each tutorial contains various aspects of ARM. Below follows a description of each tutorial:

Deploy consistent infrastructure in Azure by using Azure Resource Manager (ARM) templates

https://docs.microsoft.com/en-us/learn/modules/create-azure-resource-manager-template-vs-code/

Write Azure Resource Manager templates by using Visual Studio Code to deploy your infrastructure to Azure consistently and reliably.

  • Implement an Azure Resource Manager template by using Visual Studio Code.
  • Declare resources and add flexibility to your template by adding resources, parameters, and outputs.

 Deploy to multiple Azure environments by using ARM templates

https://docs.microsoft.com/en-us/learn/modules/modify-azure-resource-manager-template-reuse/

Manage multiple Azure environment deployments of your Azure Resource Manager templates by using functions, variables, tags, and parameter files.

  • Create an expression for a unique value by using Azure Resource Manager template functions.
  • Reuse your expression by storing it in an Azure Resource Manager template variable.
  • Organize and track your deployed Azure resources by using resource tags.
  • Manage multiple deployment parameters by using Azure Resource Manager template parameter files.

Validate your deployments by using what-if and the ARM template test toolkit

https://docs.microsoft.com/en-us/learn/modules/arm-template-test/

This module teaches two major things, how to preview your changes with the what-if operation and the value of doing so. Secondly it teaches you how to create valid templates and gives you good recommendations that you can follow using the ARM template test toolkit tool.

  • Preview what changes will happen before you deploy by using the what-if operation.
  • Validate your templates adherence to sound recommendations using ARM template test toolkit.
  • Implement domain specific rules for deployments that can be run by ARM template test toolkit.

Deploy modular and reusable ARM templates from the command line and by using GitHub Actions

https://docs.microsoft.com/en-us/learn/modules/deploy-templates-command-line-github-actions/

Learn how to deploy Azure Resource Manager (ARM) templates by using Azure PowerShell, the Azure CLI, and from GitHub Actions. Use linked templates to break down complex templates into templates that are more modular.

  • Choose the best way to deploy ARM templates, based on your needs.
  • Modularize your templates by using linked templates.
  • Learn how to create a GitHub Actions to deploy templates.
Updated Oct 21, 2020
Version 2.0
No CommentsBe the first to comment