Bird
Raised Fist0
Azurecloud~10 mins

Storage tier optimization in Azure - Interactive Code Practice

Choose your learning style10 modes available

Start learning this pattern below

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
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set the storage account's access tier to hot.

Azure
az storage account update --name myStorageAccount --resource-group myResourceGroup --access-tier [1]
Drag options to blanks, or click blank then click option'
Ahot
Bcool
Carchive
Dstandard
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 'cool' or 'archive' which are for less frequent access.
2fill in blank
medium

Complete the code to create a lifecycle management rule that moves blobs to the cool tier after 30 days.

Azure
az storage account management-policy create --account-name myStorageAccount --resource-group myResourceGroup --policy '{"rules": [{"name": "moveToCool", "enabled": true, "type": "Lifecycle", "definition": {"actions": {"baseBlob": {"tierToCool": {"daysAfterModificationGreaterThan": [1], "filters": {"blobTypes": ["blockBlob"]}}}]}'
Drag options to blanks, or click blank then click option'
A15
B90
C30
D60
Attempts:
3 left
💡 Hint
Common Mistakes
Using 15 or 60 days which do not match the requirement.
3fill in blank
hard

Fix the error in the lifecycle policy JSON to correctly archive blobs after 180 days.

Azure
"actions": {"baseBlob": {"tierToArchive": {"daysAfterModificationGreaterThan": [1]
Drag options to blanks, or click blank then click option'
A30
B365
C90
D180
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 30 or 90 days which are too short for archiving.
4fill in blank
hard

Fill both blanks to define a lifecycle rule that deletes blobs after 365 days and moves them to archive after 180 days.

Azure
"actions": {"baseBlob": {"tierToArchive": {"daysAfterModificationGreaterThan": [1], "delete": {"daysAfterModificationGreaterThan": [2]
Drag options to blanks, or click blank then click option'
A180
B365
C90
D30
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping the numbers or using incorrect days.
5fill in blank
hard

Fill all three blanks to create a lifecycle policy that moves blobs to cool after 30 days, archive after 90 days, and deletes after 365 days.

Azure
"actions": {"baseBlob": {"tierToCool": {"daysAfterModificationGreaterThan": [1], "tierToArchive": {"daysAfterModificationGreaterThan": [2], "delete": {"daysAfterModificationGreaterThan": [3]
Drag options to blanks, or click blank then click option'
A30
B90
C365
D180
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up the order or using wrong day values.

Practice

(1/5)
1. Which Azure Storage tier is best for data that you access very often?
easy
A. Archive tier
B. Cool tier
C. Hot tier
D. Premium tier

Solution

  1. Step 1: Understand storage tiers purpose

    The Hot tier is designed for data accessed frequently, providing low latency and high throughput.
  2. Step 2: Match access frequency to tier

    Since the question asks for very often access, Hot tier fits best compared to Cool (infrequent) or Archive (rare).
  3. Final Answer:

    Hot tier -> Option C
  4. Quick Check:

    Frequent access = Hot tier [OK]
Hint: Hot tier = frequent access, Cool = less, Archive = rare [OK]
Common Mistakes:
  • Confusing Cool tier as best for frequent access
  • Choosing Archive tier for active data
  • Thinking Premium tier is a storage tier
2. Which Azure CLI command correctly changes a blob's tier to Cool?
easy
A. az storage blob update-tier --tier Cool --container mycontainer --blob myblob --account mystorage
B. az storage blob set-tier --tier Cool --container-name mycontainer --name myblob --account-name mystorage
C. az storage blob change-tier --tier Cool --container mycontainer --name myblob --account mystorage
D. az storage blob tier-set --tier Cool --container mycontainer --name myblob --account mystorage

Solution

  1. Step 1: Recall correct Azure CLI syntax

    The correct command to set a blob's tier is az storage blob set-tier with parameters for tier, container, blob name, and account.
  2. Step 2: Verify az storage blob set-tier --tier Cool --container-name mycontainer --name myblob --account-name mystorage matches syntax

    az storage blob set-tier --tier Cool --container-name mycontainer --name myblob --account-name mystorage uses set-tier and correct parameter names, matching Azure CLI documentation.
  3. Final Answer:

    az storage blob set-tier --tier Cool --container-name mycontainer --name myblob --account-name mystorage -> Option B
  4. Quick Check:

    Correct CLI command = az storage blob set-tier --tier Cool --container-name mycontainer --name myblob --account-name mystorage [OK]
Hint: Use 'az storage blob set-tier' to change tier [OK]
Common Mistakes:
  • Using incorrect command verbs like update-tier
  • Wrong parameter names like --container instead of --container-name
  • Mixing blob and container parameters
3. Given this Azure CLI command:
az storage blob set-tier --tier Archive --container-name logs --name log1.txt --account-name mystorage
What happens to the blob log1.txt after this command?
medium
A. Blob remains in Hot tier with no change
B. Blob is deleted permanently
C. Blob is copied to another container
D. Blob is moved to Archive tier and becomes offline until rehydrated

Solution

  1. Step 1: Understand Archive tier behavior

    Setting a blob to Archive tier moves it to a low-cost, offline storage. It cannot be read until rehydrated.
  2. Step 2: Analyze command effect

    The command sets the tier to Archive, so the blob becomes offline and inaccessible until restored.
  3. Final Answer:

    Blob is moved to Archive tier and becomes offline until rehydrated -> Option D
  4. Quick Check:

    Archive tier = offline storage [OK]
Hint: Archive tier blobs are offline until rehydrated [OK]
Common Mistakes:
  • Thinking Archive tier deletes the blob
  • Assuming blob stays accessible immediately
  • Confusing Archive with Hot tier
4. You run this command to change a blob's tier:
az storage blob set-tier --tier Hot --container-name data --name file1.csv --account-name mystorage
But you get an error saying the blob does not exist. What is the most likely cause?
medium
A. The blob name or container name is incorrect
B. The account name is invalid
C. The tier Hot is not supported
D. The Azure CLI is outdated

Solution

  1. Step 1: Understand error meaning

    An error stating the blob does not exist usually means the blob or container name is wrong or the blob was deleted.
  2. Step 2: Check other options

    Account name errors usually give different messages; Hot tier is valid; CLI outdated causes different errors.
  3. Final Answer:

    The blob name or container name is incorrect -> Option A
  4. Quick Check:

    Blob not found = wrong name [OK]
Hint: Check blob and container names first on 'not found' errors [OK]
Common Mistakes:
  • Assuming tier Hot is invalid
  • Blaming CLI version without checking names
  • Ignoring typo in blob or container names
5. You have a large dataset stored in Azure Blob Storage. You want to minimize costs but still access some data occasionally. Which tier strategy is best?
hard
A. Store frequently accessed data in Hot tier, infrequent in Cool, and rarely accessed in Archive
B. Store all data in Archive tier and never rehydrate
C. Store all data in Cool tier regardless of access frequency
D. Store all data in Hot tier for fastest access

Solution

  1. Step 1: Understand tier cost and access trade-offs

    Hot tier is expensive but fast, Cool is cheaper for infrequent access, Archive is cheapest but offline.
  2. Step 2: Apply tier optimization best practice

    Using Hot for frequent, Cool for infrequent, and Archive for rare access balances cost and performance.
  3. Final Answer:

    Store frequently accessed data in Hot tier, infrequent in Cool, and rarely accessed in Archive -> Option A
  4. Quick Check:

    Tier data by access frequency = Store frequently accessed data in Hot tier, infrequent in Cool, and rarely accessed in Archive [OK]
Hint: Match data access frequency to tier for cost savings [OK]
Common Mistakes:
  • Putting all data in Hot tier wastes money
  • Never rehydrating Archive data makes it unusable
  • Using only Cool tier ignores access patterns