Deploy Resources using an ARM Template in the Azure Portal

30 minutes
  • 3 Learning Objectives

About this Hands-on Lab

Azure Resource Manager (ARM) templates provide a powerful way to define Azure resources and configuration, by essentially using a text file. This helps with consistency and automation of resource deployments. In this hands-on lab, you will learn how to create a storage account using an ARM template and walk through modifying the template to see how parameters and variables work.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Load the ARM Template Using the Azure Portal
  1. Download the ARM template to your computer or copy the template text from this link.
  2. Within the Azure portal, choose Create a resource and use the Template deployment (deploy using custom templates) option.
  3. Choose Build your own template in the editor and either paste the template text you copied or click Load file and select the labstoragetemplate.json file you downloaded previously.
Modify the ARM Template Parameters and Variables
  1. Modify the ARM template as follows:
    • Add a parameter called storageAccountKind and modify the resource definition to use it.
    • Create a variable called uniqueStorageAccountName and use the storageAccountName parameter and a uniqueString function to provide the resource with a unique name.
    • Change the location of the storage account resource to be hard-coded as West US.
  2. Save the template.
Deploy the ARM Template using the Parameters File
  1. Edit the parameters file as follows:
    • Set the storageAccountName to azurelab.
    • Set the storageAccountKind to StorageV2.
  2. Save the parameters.
  3. Deploy the ARM template to the existing subscription and resource group provided for this hands-on lab.

Additional Resources

Scenario

To help you walk through the lab, consider the following scenario:

You work as a cloud administrator for a company which has recently migrated to Azure. The company you work for engaged external cloud consultants to perform the migration.

As part of the migration, the consultants provided you with several ARM templates. You now need to modify one of the templates to better suit your needs. Specifically, you need to modify some of the resource definition, variables, and parameters of an ARM template which will create a storage account.


Lab Setup

Log in to the Azure portal by right-clicking Open Azure Portal and selecting the option to open it in a new private browser window. (This option will read differently depending on your browser — for example, in Chrome, it reads Open Link in Incognito Window.) Then, sign in using the credentials provided on the lab page.

All steps will be completed within the Azure portal, including editing and working with the ARM template.

A sample ARM template has been uploaded to GitHub and is provided for you here.


Additional Resources

This Microsoft article provides useful tips on ARM template best practices, and demonstrates how to modify ARM template variables and parameters in more detail. Please be aware that hard-coding the location is not a best practice, but is used in this lab to demonstrate the use of hard-coded values.

For more information on defining storage accounts in an ARM template, refer to this Microsoft reference documentation.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?