Bird
Raised Fist0
Azurecloud~5 mins

Storage tiers (Hot, Cool, Archive) in Azure - Commands & Configuration

Choose your learning style10 modes available
Introduction
Storing data in the cloud can cost different amounts depending on how often you use it. Storage tiers help you save money by choosing how quickly you need to access your data. Hot tier is for data you use often, Cool tier is for data used less often, and Archive tier is for data you rarely need but want to keep.
When you have daily active files like website images or logs that need fast access, use Hot tier.
When you have backup files or older documents accessed monthly, use Cool tier to save costs.
When you want to keep data for years, like compliance records, but rarely access it, use Archive tier.
When you want to reduce storage costs by moving data automatically based on usage patterns.
When you want to balance cost and access speed for different types of data in your storage account.
Config File - storage-tier-policy.json
storage-tier-policy.json
{
  "rules": [
    {
      "name": "move-to-cool",
      "enabled": true,
      "type": "Lifecycle",
      "definition": {
        "filters": {
          "blobTypes": ["blockBlob"]
        },
        "actions": {
          "baseBlob": {
            "tierToCool": {
              "daysAfterModificationGreaterThan": 30
            }
          }
        }
      }
    },
    {
      "name": "move-to-archive",
      "enabled": true,
      "type": "Lifecycle",
      "definition": {
        "filters": {
          "blobTypes": ["blockBlob"]
        },
        "actions": {
          "baseBlob": {
            "tierToArchive": {
              "daysAfterModificationGreaterThan": 90
            }
          }
        }
      }
    }
  ]
}

This JSON file defines a lifecycle management policy for an Azure Storage account.

The first rule moves blobs to the Cool tier if they have not been modified for more than 30 days.

The second rule moves blobs to the Archive tier if they have not been modified for more than 90 days.

This helps automate cost savings by moving data to cheaper tiers based on age.

Commands
Create a new Azure Storage account with general-purpose v2 kind and locally redundant storage.
Terminal
az storage account create --name mystorageacct123 --resource-group myResourceGroup --location eastus --sku Standard_LRS --kind StorageV2
Expected OutputExpected
{ "id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Storage/storageAccounts/mystorageacct123", "location": "eastus", "name": "mystorageacct123", "resourceGroup": "myResourceGroup", "sku": { "name": "Standard_LRS" }, "kind": "StorageV2", "statusOfPrimary": "available" }
→
--sku - Defines the replication and performance tier
→
--kind - Defines the storage account type supporting tiers
Apply the lifecycle management policy from the JSON file to automate moving blobs between Hot, Cool, and Archive tiers.
Terminal
az storage account management-policy create --account-name mystorageacct123 --resource-group myResourceGroup --policy @storage-tier-policy.json
Expected OutputExpected
{ "policy": { "rules": [ { "name": "move-to-cool", "enabled": true, "type": "Lifecycle" }, { "name": "move-to-archive", "enabled": true, "type": "Lifecycle" } ] } }
→
--policy - Specifies the lifecycle policy JSON file
Upload a file to the storage account's container to test storage tiers.
Terminal
az storage blob upload --account-name mystorageacct123 --container-name mycontainer --name example.txt --file example.txt
Expected OutputExpected
Upload blob 'example.txt' to container 'mycontainer' successfully.
→
--container-name - Specifies the container to upload the blob
Check the current access tier of the uploaded blob to verify its storage tier.
Terminal
az storage blob show --account-name mystorageacct123 --container-name mycontainer --name example.txt
Expected OutputExpected
{ "name": "example.txt", "properties": { "accessTier": "Hot", "lastModified": "2024-06-01T12:00:00Z" } }
Key Concept

If you remember nothing else from this pattern, remember: choose storage tiers based on how often you need to access your data to save money.

Common Mistakes
Not enabling lifecycle management policy after creating it
Without enabling, data will not move between tiers automatically, missing cost savings.
Always apply and verify the lifecycle policy on your storage account.
Uploading blobs to a storage account that does not support tiers (like BlobStorage kind)
Some storage account kinds do not support Cool or Archive tiers, so tiering commands fail.
Use StorageV2 kind for tiering support.
Expecting immediate tier change after upload
Tier changes happen based on policy and time, not instantly after upload.
Wait for the defined days or manually change tier if needed.
Summary
Create a StorageV2 Azure Storage account to support Hot, Cool, and Archive tiers.
Define and apply a lifecycle management policy to move blobs automatically based on age.
Upload blobs and check their access tier to confirm storage tiering behavior.

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

  1. Step 1: Understand storage tier purposes

    The Hot tier is designed for data that is accessed often and requires fast retrieval.
  2. 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.
  3. Final Answer:

    Hot tier -> Option D
  4. 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

  1. Step 1: Identify correct command for blob tier

    The command to set a blob's tier is az storage blob set-tier.
  2. Step 2: Choose correct tier parameter

    To set the Archive tier, use --tier Archive. Setting tier on storage account level is invalid.
  3. Final Answer:

    az storage blob set-tier --tier Archive -> Option C
  4. 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:
{
  "rules": [
    {
      "name": "moveToCool",
      "type": "Lifecycle",
      "definition": {
        "actions": {
          "baseBlob": {
            "tierToCool": { "daysAfterModificationGreaterThan": 30 }
          }
        },
        "filters": { "blobTypes": ["blockBlob"] }
      }
    }
  ]
}

What happens to blobs older than 30 days?
medium
A. They are moved to Hot tier
B. They are moved to Cool tier
C. They are deleted
D. They are moved to Archive tier

Solution

  1. Step 1: Analyze lifecycle rule action

    The rule specifies tierToCool for blobs modified more than 30 days ago.
  2. Step 2: Understand effect on blobs

    Blobs older than 30 days are automatically moved to the Cool tier to save cost.
  3. Final Answer:

    They are moved to Cool tier -> Option B
  4. 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

  1. Step 1: Recall Archive tier scope

    Archive tier is applied per blob, not at the storage account level.
  2. Step 2: Understand error cause

    Trying to set Archive tier on the whole account causes an error because it's unsupported.
  3. Final Answer:

    Archive tier can only be set on individual blobs, not on the whole account -> Option A
  4. 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

  1. Step 1: Identify access frequency and cost needs

    Videos are rarely accessed and cost minimization is priority, so Archive tier fits best.
  2. Step 2: Consider retrieval delay tolerance

    Archive tier retrieval can take hours, which is acceptable here.
  3. Step 3: Evaluate other options

    Hot tier is costly, Cool tier is more expensive than Archive, Premium is for performance, not cost saving.
  4. Final Answer:

    Store videos directly in Archive tier -> Option A
  5. Quick Check:

    Rare access + low cost = Archive tier [OK]
Hint: Rarely accessed + low cost = Archive tier [OK]
Common Mistakes:
  • Choosing Hot or Premium tier for rarely accessed data
  • Using Cool tier without moving to Archive
  • Ignoring retrieval delay tolerance
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard