Your profile

One profile for every MSDEVBUILD site. Only you can see it, and the site owner if you write in.

Lesson 18 of 47
❮Prev Next❯

Blob Containers, Access Tiers and Lifecycle Management

Module 2: Storage ⏱ 12 min read Updated

Your note

My notes for this lesson

Select any text in the lesson to highlight it or add a note. Saved in this browser.

    No highlights yet. Select a sentence in the lesson, then pick a colour or add a note.

    All my bookmarks and notes

    Reading settings

    For every lesson, saved in this browser.

    Text size
    Line spacing
    Font

    With IaaS you rent the virtual machine. Microsoft looks after the building, power and hardware; you patch the operating system.

    30-second answer

    A container groups blobs inside a storage account. Its anonymous access level is Private (default), Blob or Container, and anonymous access only works if the account allows it (new accounts don't). Access tiers trade storage price for access price: Hot, Cool (30-day minimum), Cold (90 days) and Archive (180 days, offline, rehydrating takes up to 15 hours at Standard priority). Archive is supported on LRS, GRS and RA-GRS accounts. A lifecycle management policy is a set of JSON rules that moves blobs to cooler tiers or deletes them (and old versions and snapshots) based on days since modification, creation or last access, and runs about once a day.

    Simulate it » No Azure account needed

    Exam objective: 2.3.2 Create and configure a container in Azure Blob Storage. 2.3.3 Configure storage tiers. 2.3.6 Configure blob lifecycle management. (Skills measured as of April 17, 2026)

    Simulations

    Feel it before you read it. No account needed, nothing leaves this page.

    Azure portal: Create a private container, change tiers and add a lifecycle rule Create a private container, change a tier and add a lifecycle rule.
    </> Embed

    Embed this simulation

    Free for trainers, teachers and bloggers. Paste this into your page:

    Loading the portal…

    Open <strong>Containers</strong> and select <strong>+ Container</strong>.

    👆 Click the glowing item in the portal to continue

    Read the steps as text
    1. Open Containers and select + Container.
    2. Name it invoices. Anonymous access level is greyed out at Private because the account doesn’t allow anonymous access. Good.
    3. One blob at a time: select invoice-2025-01.pdf → Change tier → Cold. Cool has a 30-day minimum, Cold 90, Archive 180.
    4. Doing that by hand doesn’t scale. Open Lifecycle management and + Add a rule.
    5. Details: name it, limit it with a filter, block blobs only.
    6. Base blobs: Cool after 30 days since last modified, Archive after 180. Add a delete step too if you want.
    7. Filter set: only blobs whose names start with invoices/. Select Add. The policy runs about once a day and can take up to 24 hours to start.

    🧪 Simulation for learning. Screens are simplified versions of the Azure portal; names, prices and IDs are examples. Nothing here touches real Azure.

    😟 THE PROBLEM

    Seven years of invoices sit in Hot storage and the bill keeps growing.

    😊 THE SOLUTION

    Move old blobs to Cool, Cold and Archive automatically with a lifecycle rule.

    • Paying Hot prices for old files✓ Cool, Cold, Archive
    • Moving blobs by hand✓ Lifecycle rules
    • Archive is offline✓ Plan for rehydration
    🛠️ Solved with: Access tiers + lifecycle management

    Start with a question

    Why keep last year's tax papers on your desk when they could go in a box in the loft?

    This month’s bills sit on your desk because you touch them daily. Last year’s go in a filing cabinet. Papers from five years ago go in a box in the loft: cheap to keep, but you need a ladder and an afternoon to get them out.

    Blob access tiers are the desk (Hot), the cabinet (Cool and Cold) and the loft (Archive). A lifecycle policy is the house rule that moves papers along on their own.

    Explain it like I’m 10

    The technical explanation

    Containers

    Portal: Data storage > Containers > + Container. Name it (3 to 63 lowercase letters, numbers and hyphens) and pick the anonymous access level:

    LevelAnonymous users can
    PrivateNothing (the default)
    BlobRead blobs if they know the URL
    ContainerRead blobs and list the container

    Anonymous access is possible only when the account setting Allow Blob anonymous access is on. New accounts have it off, and with it off every container stays private whatever you choose. Advanced options include a default encryption scope and version-level immutability.

    Access tiers

    TierOnlineMinimum daysGood for
    HotYesNoneData in active use
    CoolYes30Backups, older content read occasionally
    ColdYes90Rarely read, must be instant when read
    ArchiveNo180Compliance archives, raw data you may never read

    The account has a default tier (Hot, Cool or Cold) that blobs inherit; you can set a tier per blob. Moving out of a tier early adds an early deletion charge. Rough feel for 1 TB a month: Hot around $20, Archive around $2 (illustrative). Archive is available on LRS, GRS and RA-GRS accounts only.

    To read an archived blob you rehydrate it: change its tier to Hot, Cool or Cold, or copy it to an online blob. Standard priority can take up to 15 hours; High priority is usually under an hour for blobs smaller than 10 GB and costs more.

    Lifecycle management

    Portal: Data management > Lifecycle management > + Add a rule. A rule has:

    • Scope and filters: all blobs or a filter set of blob prefixes (such as invoices/) and blob index tags; blob type block blobs (append blobs support delete only); subtypes base blobs, snapshots, versions.
    • Conditions: daysAfterModificationGreaterThan, daysAfterCreationGreaterThan or daysAfterLastAccessTimeGreaterThan (which needs last access time tracking turned on).
    • Actions: tierToCool, tierToCold, tierToArchive, delete, and enableAutoTierToHotFromCool.

    A policy holds up to 100 rules. Azure runs it about once a day, and a new or changed policy can take up to 24 hours to start acting. If several actions match one blob, the cheapest one wins (delete, then Archive, then Cold, then Cool).

    { "rules": [ { "enabled": true, "name": "age-out-invoices", "type": "Lifecycle",
      "definition": {
        "filters": { "blobTypes": ["blockBlob"], "prefixMatch": ["invoices/"] },
        "actions": {
          "baseBlob": {
            "tierToCool":    { "daysAfterModificationGreaterThan": 30 },
            "tierToCold":    { "daysAfterModificationGreaterThan": 90 },
            "tierToArchive": { "daysAfterModificationGreaterThan": 180 },
            "delete":        { "daysAfterModificationGreaterThan": 2555 } },
          "version": { "delete": { "daysAfterCreationGreaterThan": 90 } } } } } ] }
    az storage container create --account-name stcontosoprod -n invoices          # private
    az storage blob set-tier --account-name stcontosoprod -c invoices -n invoice-2025-01.pdf --tier Cold
    az storage account management-policy create -g rg-storage-prod --account-name stcontosoprod \
      --policy @lifecycle.json
    $ctx = (Get-AzStorageAccount -ResourceGroupName rg-storage-prod -Name stcontosoprod).Context
    New-AzStorageContainer -Name invoices -Permission Off -Context $ctx
    $blob = Get-AzStorageBlob -Container invoices -Blob invoice-2025-01.pdf -Context $ctx
    $blob.BlobClient.SetAccessTier("Cold")
    Architect level Smaller details that cost money

    Changing tiers costs write operations, and reading Cool, Cold and Archive data costs more per GB. Lifecycle rules that move millions of tiny blobs can cost more than they save, so filter by prefix and consider packing small files. Versions and snapshots are billed too; give them their own delete actions in the same policy.

    Real-world business scenario

    Insurance

    Proseware Insurance (fictional)

    The problem
    Seven years of claim PDFs sat in Hot storage. Almost nothing older than a month was opened, and the storage bill grew every quarter.
    What they used
    A private claims container in a GRS account with a lifecycle rule: Cool after 30 days, Cold after 90, Archive after 180 and delete after seven years, plus a rule deleting old versions after 90 days.
    Why that choice
    Old claims cost a fraction of Hot prices, and nobody has to move files by hand. The rare archived claim is rehydrated with High priority.
    The result
    Storage cost for the container dropped sharply within six months, and auditors still get any claim within an hour.

    When to use it and when not to

    ✓ Use it when…

    • Data whose use drops with age, such as invoices, logs and backups.
    • Compliance data you must keep for years but rarely read (Archive).
    • Tidying up old versions and snapshots automatically.

    ✕ Think twice when…

    • Data read unpredictably and urgently (Archive latency hurts).
    • Short-lived data deleted within 30 days (early deletion charges in Cool).
    • Zone-redundant accounts if you need Archive (not supported there).

    ↔ Alternatives to consider

    • Cold tier instead of Archive when reads must be instant.
    • Smart, per-blob tiering by last access with enableAutoTierToHotFromCool.
    Ready for more?The full lesson adds the technical explanation, when to use it, interview questions and revision notes.

    Test yourself with exercises

    5 original practice questions in the AZ-104 style. Pick your answers, then check them. You will see why each option is right or wrong. Score 75% or more and this topic is marked complete.

    Question 1

    Question 1 of 5

    Audit records are rarely read but must be available within milliseconds when requested. They are kept for at least six months. You need to minimize storage cost. Which access tier should you use?

    Question 2

    Question 2 of 5

    A blob in the Archive tier must be read urgently. The blob is 2 GB. What should you do?

    Question 3

    Question 3 of 5

    You attempt to create a container with the anonymous access level set to Blob. The operation fails with PublicAccessNotPermitted. What should you do to allow anonymous access?

    Question 4

    Question 4 of 5

    You need to move block blobs to the Cool tier when they have not been read for 60 days. What must you configure before the lifecycle rule can use this condition?

    Question 5

    Question 5 of 5

    You create a lifecycle management policy that moves blobs to the Archive tier after 180 days. The storage account uses ZRS. What should you expect?

    Interview preparation

    Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.

    Beginner What's the difference between Cool and Archive?

    Model answer

    Cool is online: you can read a blob immediately, you just pay more per read and a bit less per GB than Hot, with a 30-day minimum. Archive is offline: it's the cheapest storage, but you can't read the blob until you rehydrate it, which can take up to 15 hours at Standard priority, and there's a 180-day minimum.

    Intermediate You try to create a container with anonymous blob access and get an error. Why?

    Model answer

    The account setting Allow Blob anonymous access is off, which is the default for new accounts. No container can be made public until that's turned on at account level. I'd only do that for content that really should be public, and keep everything else private and shared with SAS.

    Experienced developer How would you write a lifecycle rule for blobs that should go cool once nobody reads them?

    Model answer

    Turn on last access time tracking for the account, then use daysAfterLastAccessTimeGreaterThan in the tierToCool action, and optionally enableAutoTierToHotFromCool so a blob that gets read again goes back to Hot. Rules based on modification time don't need tracking. I'd filter with a prefix or blob index tags so the rule doesn't touch everything.

    Scenario Finance keeps invoices for seven years and rarely opens anything older than a month. Design the storage.

    Model answer

    A private invoices container in an LRS or GRS account, because Archive isn't available on zone-redundant accounts. A lifecycle rule with prefix invoices/ moving blobs to Cool after 30 days, Cold after 90, Archive after 180, and deleting after about 2,555 days. Finance knows an archived invoice needs rehydrating, and urgent ones can use High priority.

    Quick revision

    Key points

    • Container names 3-63 lowercase letters, numbers and hyphens.
    • Anonymous access needs the account setting on; new accounts block it.
    • Hot, Cool (30 d), Cold (90 d), Archive (180 d, offline).
    • Rehydrate Archive with Set Blob Tier or a copy; Standard up to 15 hours, High usually under 1 hour for blobs under 10 GB.
    • Archive works on LRS, GRS, RA-GRS only.
    • Lifecycle rules run about daily; new policies can take up to 24 hours to act.

    Important terminology

    Container
    A named group of blobs in a storage account, similar to a top-level folder.
    Anonymous access level
    Private, Blob (anonymous read of blobs) or Container (anonymous read and list), allowed only if the account permits anonymous access.
    Access tier
    Hot, Cool, Cold or Archive, which sets the balance between storage cost and access cost for a blob.
    Early deletion charge
    A charge for moving or deleting a blob before the tier's minimum days (30 Cool, 90 Cold, 180 Archive).
    Rehydration
    Moving an archived blob back to an online tier so it can be read. Standard or High priority.
    Lifecycle management policy
    Account-level JSON rules that move or delete blobs, versions and snapshots by age or last access.

    Common mistakes

    • Setting Archive as the account default tier (only Hot, Cool or Cold can be).
    • Using daysAfterLastAccessTimeGreaterThan without enabling access tracking.
    • Expecting a lifecycle change to happen instantly.

    Exam tips

    • "Cheapest storage, can wait hours to read" = Archive.
    • "Rarely read, needed immediately when read" = Cool or Cold.
    • "Move blobs automatically by age" = lifecycle management.

    Five quick revision questions

    1. 1.What is the minimum storage duration for the Cold tier?Show

      90 days.

    2. 2.How long can Standard priority rehydration from Archive take?Show

      Up to 15 hours.

    3. 3.Which account redundancy options support the Archive tier?Show

      LRS, GRS and RA-GRS.

    4. 4.Which lifecycle condition needs last access time tracking?Show

      daysAfterLastAccessTimeGreaterThan.

    5. 5.Which anonymous access level allows listing blobs in a container?Show

      Container.

    Official references

    Finished this lesson? Tick it off. Your progress is saved in this browser.

    Next up: Blob Soft Delete and Versioning

    Studying with a friend? Send them this lesson

    It's free and needs no sign-up. Their progress saves in their own browser.

    Lesson done? Make it stick with a quick gameSort It, Match the Pairs, Lightning Round and Who Am I? Earn XP and badges. Play ❯

    Install MSDEVBUILD Azure

    Free · no account · works offline

    Save the whole course for offline ›

    Hi, I’m your Nimbus

    Your study buddy. Pick what we do next.

    MSDEVBUILD · Multi-Stack Dev Build

    Sign in to MSDEVBUILD

    One account for Azure certifications and the blog: sign in here and you are signed in on both. Your XP, streak, practice deck and certificate stay in sync on every device. Optional: everything works without an account.