0
0
Azurecloud~30 mins

ARM template structure in Azure - Mini Project: Build & Apply

Choose your learning style9 modes available
ARM template structure
📖 Scenario: You are working as a cloud engineer for a small company. Your manager wants you to create a simple Azure Resource Manager (ARM) template to deploy a storage account. This template will help automate the deployment process and ensure consistency.
🎯 Goal: Create a basic ARM template with the correct structure to deploy an Azure Storage Account resource.
📋 What You'll Learn
Create the ARM template skeleton with schema, contentVersion, parameters, variables, resources, and outputs sections.
Add a parameter called storageAccountName of type string.
Add a resource of type Microsoft.Storage/storageAccounts with API version 2022-09-01.
Set the storage account name using the storageAccountName parameter.
Set the location to eastus.
Set the SKU name to Standard_LRS.
Set the kind to StorageV2.
Output the storage account resource ID.
💡 Why This Matters
🌍 Real World
ARM templates are used to automate and standardize Azure resource deployments in real companies, saving time and reducing errors.
💼 Career
Understanding ARM template structure is essential for cloud engineers and DevOps professionals working with Azure infrastructure automation.
Progress0 / 4 steps
1
Create the ARM template skeleton
Create an ARM template JSON with the top-level keys: $schema, contentVersion, parameters, variables, resources, and outputs. Set $schema to "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#" and contentVersion to "1.0.0.0". Leave parameters, variables, resources, and outputs as empty objects or arrays as appropriate.
Azure
Need a hint?

Start by creating the main structure of an ARM template with the required top-level keys.

2
Add a parameter for storage account name
Inside the parameters section, add a parameter called storageAccountName of type string.
Azure
Need a hint?

Parameters allow you to pass values when deploying the template. Add the storageAccountName parameter with type string.

3
Add the storage account resource
Inside the resources array, add a resource object with type set to Microsoft.Storage/storageAccounts, apiVersion set to 2022-09-01, name set to the parameter storageAccountName, location set to eastus, sku with name as Standard_LRS, and kind set to StorageV2. Leave properties as an empty object.
Azure
Need a hint?

The resource section defines what Azure resources to create. Use the parameter for the storage account name and set the required properties.

4
Add output for the storage account resource ID
Inside the outputs section, add an output called storageAccountId of type string. Set its value to the resource ID of the storage account using the ARM function resourceId with the resource type Microsoft.Storage/storageAccounts and the storage account name parameter.
Azure
Need a hint?

Outputs let you get information about deployed resources. Use the resourceId function to get the storage account's ID.