Jump into concepts and practice - no test required
or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Create an ARM Template Resources Section
📖 Scenario: You are setting up a simple Azure infrastructure using an ARM template. You want to define the resources section to deploy a storage account.
🎯 Goal: Build the resources section of an ARM template that defines a storage account with specific properties.
📋 What You'll Learn
Create a resources array with one resource object
Define a storage account resource with type Microsoft.Storage/storageAccounts
Set the API version to 2022-09-01
Include the name mystorageaccount
Set the location to eastus
Set the SKU name to Standard_LRS
Set the kind to StorageV2
Add supportsHttpsTrafficOnly property set to true
💡 Why This Matters
🌍 Real World
ARM templates are used to automate Azure infrastructure deployment. Defining the resources section correctly is essential to create and manage cloud resources.
💼 Career
Cloud engineers and DevOps professionals use ARM templates to deploy and maintain Azure resources efficiently and consistently.
Progress0 / 4 steps
1
Create the resources array
Create a variable called resources and set it to an empty array [].
Azure
Hint
Start by creating an empty array to hold your resources.
2
Add a storage account resource object
Add an object to the resources array with the following properties: type set to "Microsoft.Storage/storageAccounts", apiVersion set to "2022-09-01", and name set to "mystorageaccount".
Azure
Hint
Add an object inside the array with the required properties.
3
Add location, sku, and kind properties
Inside the storage account object in resources, add the properties location set to "eastus", sku as an object with name set to "Standard_LRS", and kind set to "StorageV2".
Azure
Hint
Remember to add the location as a string, sku as an object with a name, and kind as a string.
4
Add supportsHttpsTrafficOnly property
Inside the storage account object in resources, add the properties object with supportsHttpsTrafficOnly set to true.
Azure
Hint
Add a properties object and set supportsHttpsTrafficOnly to true inside it.
Practice
(1/5)
1. What is the main purpose of the resources section in an ARM template?
easy
A. To list all cloud parts to create or update
B. To write scripts for manual deployment
C. To store user credentials securely
D. To monitor cloud resource usage
Solution
Step 1: Understand the role of the resources section
The resources section defines what cloud parts (like servers, databases) to create or update automatically.
Step 2: Compare options with this role
Only To list all cloud parts to create or update correctly describes this purpose. Other options describe unrelated tasks.
Final Answer:
To list all cloud parts to create or update -> Option A
Quick Check:
Resources section = list cloud parts [OK]
Hint: Resources section always defines cloud parts to deploy [OK]
Common Mistakes:
Thinking resources section stores credentials
Confusing resources with monitoring tools
Assuming resources section is for scripts
2. Which of the following is a required property inside each resource in the resources section of an ARM template?
easy
A. version
B. dependsOn
C. location
D. tags
Solution
Step 1: Identify required properties for each resource
Every Azure resource requires type, apiVersion, and name. The location property is required for regional resources to specify where the resource is created.
Step 2: Check options for required property
location (location) is required. version is incorrect; the correct property is apiVersion. tags and dependsOn are optional.
Final Answer:
location -> Option C
Quick Check:
Location is required for resource placement [OK]
Hint: Location is required for regional resources [OK]
Common Mistakes:
Confusing apiVersion with version
Assuming tags are mandatory
Thinking dependsOn is always required
3. Given this resource snippet in an ARM template's resources section:
A. Deployment fails due to missing 'dependsOn' property
B. A new storage account named 'mystorageaccount' is created in East US
C. The storage account is created but with default SKU
D. The template will error because 'kind' is invalid
Solution
Step 1: Analyze resource properties
The resource defines a storage account with a valid type, apiVersion, name, location, sku, and kind. All required fields are present and valid.
Step 2: Understand deployment behavior
Since all required properties are correct, deployment will create the storage account named 'mystorageaccount' in 'eastus' with the specified SKU and kind. dependsOn is optional here.
Final Answer:
A new storage account named 'mystorageaccount' is created in East US -> Option B
Deployment fails with an error about missing properties. What is the likely cause?
medium
A. Missing 'properties' section with site configuration
B. Missing required 'kind' property for web app
C. Missing 'dependsOn' property for resource order
D. Missing 'sku' property defining pricing tier
Solution
Step 1: Review required properties for Microsoft.Web/sites
Besides type, apiVersion, name, and location, a web app resource requires a properties section to define site settings.
Step 2: Identify missing required section
The snippet lacks the properties section, causing deployment failure. sku and dependsOn are optional, and kind defaults to 'app' if omitted.
Final Answer:
Missing 'properties' section with site configuration -> Option A
Quick Check:
Web app needs properties section [OK]
Hint: Web apps require properties section; check for it [OK]
Common Mistakes:
Assuming dependsOn is mandatory
Confusing kind as required
Ignoring properties section necessity
5. You want to deploy two resources in an ARM template: a storage account and a web app that uses that storage. How do you ensure the web app deploys only after the storage account is ready?
hard
A. Use the same 'apiVersion' for both resources
B. Place the web app resource before the storage account in the resources array
C. Set the web app's 'location' to the storage account's location
D. Add the storage account's name in the web app's 'dependsOn' property
Solution
Step 1: Understand resource deployment order control
ARM templates use the dependsOn property to specify that one resource must finish deploying before another starts.
Step 2: Apply dependsOn for correct order
Adding the storage account's resource name in the web app's dependsOn ensures the web app waits for the storage account to be ready.
Final Answer:
Add the storage account's name in the web app's 'dependsOn' property -> Option D
Quick Check:
dependsOn controls deployment order [OK]
Hint: Use dependsOn to order resource deployment [OK]
Common Mistakes:
Thinking resource order in array controls deployment