📖 Scenario: You work for a company that stores different types of files in Azure Blob Storage. Some files are accessed frequently, some less often, and some rarely. To save money, you want to organize these files into different storage tiers: Hot for frequent access, Cool for infrequent access, and Archive for rarely accessed files.
🎯 Goal: Create an Azure Storage account configuration that defines three containers, each using a different storage tier: Hot, Cool, and Archive. This setup will help the company optimize costs based on how often files are accessed.
📋 What You'll Learn
Create a dictionary called storage_containers with container names as keys and their storage tiers as values.
Add a variable called default_tier set to 'Hot' to use as a fallback tier.
Write a loop that creates a new dictionary container_settings with container names as keys and a dictionary of settings including the tier.
Add a final configuration dictionary called storage_account_config that includes the container_settings and a property account_tier set to 'Standard'.
💡 Why This Matters
🌍 Real World
Cloud storage costs vary by how often data is accessed. Using storage tiers helps companies save money by placing data in the right tier based on usage.
💼 Career
Cloud engineers and administrators often configure storage accounts with tiering to optimize costs and performance.
Progress0 / 4 steps
1
Create the initial storage containers dictionary
Create a dictionary called storage_containers with these exact entries: 'images': 'Hot', 'videos': 'Cool', 'archives': 'Archive'.
Azure
Hint
Use curly braces to create a dictionary with the exact keys and values.
2
Add a default storage tier variable
Add a variable called default_tier and set it to the string 'Hot'.
Azure
Hint
Just assign the string 'Hot' to the variable named default_tier.
3
Create container settings with tiers
Write a for loop using variables container and tier to iterate over storage_containers.items(). Inside the loop, add entries to a new dictionary called container_settings where each key is the container name and the value is a dictionary with a key 'tier' set to the tier value.
Azure
Hint
Initialize an empty dictionary before the loop. Then add each container with its tier inside the loop.
4
Add final storage account configuration
Create a dictionary called storage_account_config with two keys: 'containers' set to container_settings and 'account_tier' set to the string 'Standard'.
Azure
Hint
Use curly braces to create the dictionary with the exact keys and values.
Practice
(1/5)
1. Which Azure Storage tier is best for data that you need to access frequently and quickly?
easy
A. Premium tier
B. Cool tier
C. Archive tier
D. Hot tier
Solution
Step 1: Understand storage tier purposes
The Hot tier is designed for data that is accessed often and requires fast retrieval.
Step 2: Compare with other tiers
Cool tier is for infrequent access, Archive is for rarely accessed data, and Premium is a performance option but not a tier for access frequency.
Final Answer:
Hot tier -> Option D
Quick Check:
Frequent access = Hot tier [OK]
Hint: Hot tier = frequent access, fastest retrieval [OK]
Common Mistakes:
Confusing Cool tier with Hot tier
Thinking Archive tier is for frequent access
Assuming Premium tier is a storage access tier
2. Which of the following is the correct way to specify the Archive tier for a blob in Azure Storage using Azure CLI?
easy
A. az storage account set-tier --tier Archive
B. az storage blob set-tier --tier Hot
C. az storage blob set-tier --tier Archive
D. az storage blob update --tier Cool
Solution
Step 1: Identify correct command for blob tier
The command to set a blob's tier is az storage blob set-tier.
Step 2: Choose correct tier parameter
To set the Archive tier, use --tier Archive. Setting tier on storage account level is invalid.
Final Answer:
az storage blob set-tier --tier Archive -> Option C
Quick Check:
Blob tier set with az storage blob set-tier [OK]
Hint: Use az storage blob set-tier for Archive tier [OK]
Common Mistakes:
Trying to set tier on storage account instead of blob
Using wrong command like az storage blob update
Confusing tier names or casing
3. Consider this Azure Storage blob lifecycle rule snippet:
The rule specifies tierToCool for blobs modified more than 30 days ago.
Step 2: Understand effect on blobs
Blobs older than 30 days are automatically moved to the Cool tier to save cost.
Final Answer:
They are moved to Cool tier -> Option B
Quick Check:
30+ days old blobs -> Cool tier [OK]
Hint: tierToCool means move blobs older than X days to Cool [OK]
Common Mistakes:
Assuming blobs move to Archive instead of Cool
Thinking blobs are deleted by this rule
Confusing tierToCool with tierToHot
4. You try to set the Archive tier on an entire Azure Storage account but get an error. What is the likely cause?
medium
A. Archive tier can only be set on individual blobs, not on the whole account
B. You must enable Archive tier feature in the portal first
C. Archive tier requires Premium storage account type
D. Archive tier is only for file shares, not blobs
Solution
Step 1: Recall Archive tier scope
Archive tier is applied per blob, not at the storage account level.
Step 2: Understand error cause
Trying to set Archive tier on the whole account causes an error because it's unsupported.
Final Answer:
Archive tier can only be set on individual blobs, not on the whole account -> Option A
Quick Check:
Archive tier scope = per blob [OK]
Hint: Archive tier applies only to blobs, not entire account [OK]
Common Mistakes:
Thinking Archive tier needs special enablement
Assuming Archive tier requires Premium account
Confusing Archive tier with file share tiers
5. A company stores large video files that are rarely accessed but must be retained for years. They want to minimize storage costs but can tolerate hours of retrieval delay. Which Azure Storage tier strategy should they use?
hard
A. Store videos directly in Archive tier
B. Store videos in Cool tier and move to Archive after 90 days
C. Store videos in Hot tier for fast access
D. Store videos in Premium tier for best performance
Solution
Step 1: Identify access frequency and cost needs
Videos are rarely accessed and cost minimization is priority, so Archive tier fits best.
Step 2: Consider retrieval delay tolerance
Archive tier retrieval can take hours, which is acceptable here.
Step 3: Evaluate other options
Hot tier is costly, Cool tier is more expensive than Archive, Premium is for performance, not cost saving.