SaveMyCert
Log in
5 of 5 free questions left today·for 30 a day
Implement and manage storage

Configure Azure Files and Azure Blob Storage (AZ-104)

22 min readAZ-104 · Implement and manage storageUpdated

Azure Files and Azure Blob Storage are the two data services inside an Azure storage account that you configure most as an administrator: Azure Files provides managed SMB and NFS file shares, and Blob Storage provides containers of objects addressed over HTTPS. The AZ-104 exam tests the practical settings that keep that data available, recoverable and cheap. For Azure Files that means choosing a protocol, billing model and tier, mounting the share, and protecting it with share snapshots and share soft delete. For Blob Storage it means choosing a blob type, setting a container's anonymous access level and immutability policy, picking the hot, cool, cold or archive tier (and rehydrating archived data), and combining soft delete, versioning and lifecycle management rules that move and delete data automatically as it ages. This lesson walks through each setting and, just as importantly, the limits that decide which option actually works in a given scenario.

What you’ll learn
  • Choose between Azure Files and Blob Storage, and pick the blob type and write pattern a workload needs
  • Create an SMB or NFS file share, choose its billing model and access tier, and mount it securely
  • Protect file shares with share snapshots and share soft delete, and know how each restores data
  • Create a blob container, set its anonymous access level, and apply time-based retention or a legal hold
  • Choose between the hot, cool, cold and archive tiers, account for early deletion, and rehydrate archived blobs
  • Configure blob soft delete, container soft delete and blob versioning, and pick the right restore path
  • Author lifecycle management rules with the correct filters, conditions and actions

Azure Files versus Azure Blob Storage: what each is for

Azure Files provides managed file shares that many clients mount at once like a network drive, while Azure Blob Storage provides object storage in containers that applications and browsers reach over HTTP(S). Choosing between them is the first decision the exam tests.

Azure Files exposes the SMB and NFS protocols, a real folder hierarchy and file-system semantics such as file locking, so several virtual machines can map the same drive letter and safely share files. Choose it when an application expects a file server and you want to lift and shift without rewriting, or to replace an on-premises file server. A managed disk, by contrast, is block storage attached to one VM (shared disks need cluster software to coordinate writes), and blob storage has no SMB locking or drive letter.

Blob Storage holds unstructured data — images, video, backups, logs, documents — as blobs inside containers. Every blob has its own URL, and a container can be opened for anonymous read, which Azure Files never allows: a file in a share can be fetched by URL only with a SAS token or other credential. Blob Storage is therefore the fit for public downloads, static content and very large, cheap archives.

Both services live in the same storage account and share its name, redundancy and network settings, but their data-protection features differ.

FeatureAzure FilesBlob Storage
AccessMount over SMB (port 445) or NFS 4.1; REST with a credentialHTTPS REST/SDK; optional anonymous read per container
Cost tiersTransaction optimized, hot, cool (pay-as-you-go standard shares only)Hot, cool, cold, archive per blob
Point-in-time copiesShare snapshots (whole share)Blob snapshots and blob versioning
Undo a deletionFile share soft deleteBlob soft delete and container soft delete
Automatic ageingNoneLifecycle management rules
Write-once protectionNoneImmutability policies (time-based retention, legal hold)

Create and configure a file share in Azure Files

You create a file share in a storage account under Data storage > File shares > + File share, and the settings that matter are the protocol, the media and billing model (which decide whether access tiers exist), the size, and how clients will reach it.

Protocol and account kind

SMB is the default and works from Windows, Linux and macOS. NFS 4.1 is for Linux clients and is available only on SSD (premium) file shares (for classic shares, a FileStorage storage account); a standard general-purpose v2 account cannot host an NFS share. A share uses one protocol for its whole life.

Billing models and Azure Files access tiers

Azure Files has three billing models, and only one of them has access tiers.

Billing modelMedia / accountAccess tiers?How you pay
Pay-as-you-goHDD (standard), general-purpose v2Yes: transaction optimized, hot, coolPer GiB stored plus per transaction; the quota only caps size
Provisioned v2HDD or SSDNoFor the storage, IOPS and throughput you provision
Provisioned v1SSD (premium), FileStorageNoFor the provisioned size

The three pay-as-you-go tiers are all the same HDD hardware with different prices, so a tier is a cost decision, not a performance one. Transaction optimized has the highest storage price and the lowest transaction price, so it suits shares with heavy read/write activity. Hot is the general-purpose middle. Cool has the lowest storage price and the highest transaction price, so it suits data kept online but read rarely, such as archived records that must stay readable without a rehydration wait. You can change a pay-as-you-go share between these tiers in place (it costs transactions to move the data). Getting SSD latency, however, is not a tier change: you create a new share on SSD in a FileStorage account and copy the data into it with a tool such as AzCopy or Robocopy.

Mounting and network access

From Windows you map an SMB share with the UNC path \\account.file.core.windows.net\sharename; the portal generates a ready-made script. From Linux you mount SMB with cifs or NFS with the NFS client. SMB uses TCP port 445, and many home internet providers and corporate firewalls block that port outbound. That block sits on the client's network, so nothing on the storage account fixes it: firewall rules, virtual network rules and service endpoints only decide which networks Azure accepts traffic from. The fix is to give the client a private path — a Point-to-Site or Site-to-Site VPN, or ExpressRoute — to a private endpoint for the account, so SMB travels inside the tunnel. (Azure File Sync, which caches a share on an on-premises Windows Server, is another way to serve the data locally; it is not part of this task's current skills outline.)

NFS shares have no user or key authentication. Storage account keys, SAS tokens and Kerberos do not authorize an NFS mount; access is controlled at the network level, so an NFS share must be reached through a private endpoint or a virtual network rule (service endpoint), and the account should never be open to the whole internet. SMB shares, in contrast, are mounted with the account key or with identity-based authentication, which the Configure access to storage lesson covers.

Snapshots and soft delete for Azure Files

Azure Files has two independent protection layers: share snapshots recover files to an earlier point in time, and file share soft delete recovers a share that was deleted.

Share snapshots

A share snapshot is a read-only, point-in-time copy of the entire share. Snapshots are incremental — each stores only the data that changed since the previous one — so frequent snapshots are affordable. You take them manually under File shares > the share > Snapshots, or on a schedule with Azure Backup, which manages share snapshots and their retention for you. To recover, you browse a snapshot and copy back a single file or folder, or restore the whole share. On Windows clients with the share mounted, snapshots appear in a file's Previous Versions tab, so users can restore one file themselves without affecting anything else on the share. A share that has snapshots cannot be deleted until its snapshots are deleted too (the portal offers to delete them together).

File share soft delete

Soft delete is configured at the storage-account level and is enabled by default for new storage accounts, with a default retention of 7 days (configurable from 1 to 365 days). A deleted share moves to a soft-deleted state instead of being destroyed. In the portal you turn on Show deleted shares and Undelete it, which restores the share with all its contents and its share snapshots — so if a share was deleted together with its snapshots, you undelete the share first and then recover files from the snapshots as usual.

  • Changing the retention period or disabling soft delete is not retroactive: shares already soft-deleted keep the retention they were deleted under.
  • A soft-deleted share still counts toward the account's capacity (for provisioned shares, its provisioned size). To purge one early, undelete it, disable soft delete, delete it again, then re-enable soft delete.
  • Soft delete protects whole shares, not individual files; recovering a single deleted or overwritten file is the job of snapshots.

Create and configure a container in Azure Blob Storage

Blobs live in containers, which you create under Data storage > Containers > + Container. The settings that matter are the anonymous access level, any immutability policy (next section), and an understanding of the blob types applications will write into it.

Anonymous access level

Access levelWho can read anonymouslyTypical use
Private (no anonymous access)Nobody — every request needs a key, SAS, or Entra identityThe secure default for business data
BlobAnonymous read of individual blobs by direct URL, but the container cannot be listedPublic downloads where you share exact URLs
ContainerAnonymous read and list of every blob in the containerFully public content where listing is acceptable

Two settings above the container also apply. First, the account setting Allow Blob anonymous access is disabled by default on new accounts; while it is off, the container level is greyed out at Private, so you enable it in the account's Configuration first. Second, anonymous requests are still subject to the account's networking firewall: if public network access is limited to selected virtual networks and IP addresses, an anonymous caller from an unlisted IP is refused even though the container is public. Keep containers private unless there is a clear reason to publish, and use SAS tokens for scoped, temporary sharing.

Blob types and how each is written

You do not choose a blob type when you create a container; the type is fixed when each blob is created, and it decides which write operations work.

Blob typeHow it is writtenFits
Block blobPut Blob uploads a whole blob in one call; large uploads stage blocks with Put Block and commit them with Put Block List. Changing content means committing a new block list.Most files, media, backups, documents
Append blobAppend Block adds a block to the end; existing blocks cannot be modified or deletedLogs and audit trails that only grow
Page blobPut Page writes ranges in place at 512-byte-aligned offsets, up to 8 TiB per blobRandom read/write files such as VM disks (VHDs)

Access tiers, lifecycle tiering actions and point-in-time restore apply to block blobs, which is another reason to know which type a workload uses.

Storage access tiers and rehydrating archived blobs

An access tier trades storage cost against access cost and retrieval latency for block blobs: hotter tiers cost more to store and less to read, cooler tiers the reverse, with minimum retention periods and, for archive, a delay before data can be read at all.

TierBest forStorage costAccess costAvailability / retrievalMin. retention
HotData accessed frequentlyHighestLowestOnline — millisecondsNone
CoolInfrequently accessed, kept 30+ daysLowerHigherOnline — milliseconds30 days
ColdRarely accessed, kept 90+ daysLower stillHigher stillOnline — milliseconds90 days
ArchiveRarely accessed, long-term retention, hours of latency acceptableLowestHighestOffline — must rehydrate first180 days

Hot, cool and cold are online tiers read immediately; archive is offline. You set the tier at two scopes: the account's default access tier, which new blobs without an explicit tier inherit (hot unless you change it; archive can never be the default), and a per-blob tier set explicitly or by a lifecycle rule. For data read a few times a year that must still open instantly, cold is the cheapest online choice.

Archive is not available everywhere. It is supported only on accounts using LRS, GRS or RA-GRS; accounts on ZRS, GZRS or RA-GZRS cannot archive blobs. If policy requires zone redundancy, cold is the cheapest tier available — changing redundancy just to archive would break the requirement.

Early deletion. A blob that is deleted, overwritten or moved to a different tier before its tier's minimum retention period incurs an early-deletion charge for the remaining days, prorated. For example, a blob moved to cool and deleted after 10 days is charged for the 20 days it still owed, and a blob moved out of archive after 45 days is charged for 135 days.

Rehydrating archived blobs

An archived blob cannot be read, copied to archive, snapshotted or modified until it is rehydrated to an online tier. There are two ways:

  • Set Blob Tier on the blob to hot, cool or cold — it rehydrates in place, and the blob's tier shows as archive (with a pending status) until the operation finishes.
  • Copy the archived blob to a new blob with an online destination tier — the original stays in archive, so you pay for two copies.

Either way you choose a rehydration priority. Standard can take up to 15 hours. High costs more and is processed first; it can complete in under one hour for blobs smaller than 10 GB, though that is not guaranteed and larger blobs take longer. A pending request cannot be cancelled, and its priority can only be raised from Standard to High — by calling Set Blob Tier again with the same target tier and High priority — never lowered. High-priority retrieval throughput is limited per storage account (on the order of 10 GiB per hour), so rehydrating a large volume at High priority still takes time.

One side effect matters for automation: Set Blob Tier does not change the blob's last-modified time. A lifecycle rule that archives blobs by days since modification will therefore see a freshly rehydrated old blob as still old and archive it again on its next ruy — see the daysAfterLastTierChangeGreaterThan condition in the lifecycle section.

Soft delete and blob versioning

Blob data has three account-level recovery features — blob soft delete, container soft delete and blob versioning — and the exam tests both which one to enable and how a restore actually works with each.

Blob soft delete

Blob soft delete keeps deleted data for a retention period of 1 to 365 days. A deleted blob becomes soft-deleted, and you recover it with Undelete Blob, which also restores its soft-deleted snapshots. Soft delete also covers overwrites: when versioning is off, overwriting a blob saves the old content as a soft-deleted snapshot. Everything protected this way expires when the retention window passes.

Container soft delete

Container soft delete is a separate setting (also 1–365 days) that recovers a whole deleted container with its blobs. It does not protect individual blob deletions in a container that still exists — that needs blob soft delete — so enable both to cover both mistakes. A container can be restored only to its original name; if a new container with that name has been created since, the restore fails until you move any data you need out of the new container and delete it. Neither feature protects against deleting the storage account itself (use a resource lock for that).

Blob versioning

With versioning on, every write or delete automatically preserves the previous state as a version with its own version ID; the latest write is the current version. Versions do not expire — they persist until you or a lifecycle rule deletes them — so versioning is the choice when every prior state must be kept indefinitely, while soft delete is a time-limited safety net. Every version is billed, so pair versioning with a lifecycle rule that deletes old versions.

Which restore path works

SituationVersioning off (soft delete on)Versioning on
Blob deletedUndelete BlobThe current version becomes a previous version; copy that previous version over the base blob
Blob overwrittenUndelete Blob to restore the soft-deleted snapshot, then copy the snapshot over the base blobCopy the previous version over the base blob

When both features are on, overwrites and deletes create versions, not soft-deleted snapshots, and soft delete protects those versions from being deleted. Undelete Blob never promotes a version to current: it only restores soft-deleted versions or snapshots, so recovery always ends by copying the wanted version over the base blob.

Point-in-time restore

Point-in-time restore rolls a set of block blobs (a whole account, containers, or prefix ranges) back to their state at an earlier time. It requires blob soft delete, change feed and blob versioning to be enabled, and its restore window must be shorter than the soft-delete retention. It cannot restore a deleted container (that is container soft delete), and it is heavier than needed to recover one blob — use it for bulk rollback, such as after a faulty job corrupts many blobs.

Blob lifecycle management and a real scenario

Blob lifecycle management is a per-account policy of up to 100 rules that move blobs to cooler tiers and delete them automatically as they age — the answer whenever a scenario asks for tiering or clean-up "automatically, without scripts". Each rule has filters, which pick the blobs, and actions with conditions, which say what happens and when.

Filters

  • blobTypes (required): blockBlob and/or appendBlob. Page blobs are not managed.
  • prefixMatch: strings that start with the container name — sample-container/blob1 matches every blob in sample-container whose name begins with blob1. Prefixes are literal: no wildcards. Without a prefix filter, the rule applies to every container in the account.
  • blobIndexMatch: blob index tag conditions (for example Project = Contoso), for targeting blobs by tag rather than by name.

Actions and conditions

Actions are tierToCool, tierToCold, tierToArchive and delete, set separately for the current blob (baseBlob), version and snapshot. Tiering actions apply only to block blobs; for append blobs the only action is delete. Conditions on the current blob are:

ConditionCounts days sinceNote
daysAfterModificationGreaterThanLast modificationThe classic ageing condition
daysAfterCreationGreaterThanCreationAlso the condition for versions and snapshots
daysAfterLastAccessTimeGreaterThanLast read or writeRequires last access time tracking to be enabled on the account first
daysAfterLastTierChangeGreaterThanLast tier changeUsed with tierToArchive so a just-rehydrated blob is not re-archived

With last access time tracking on, a tierToCool action based on last access can also set enableAutoTierToHotFromCool, which moves a cool blob back to hot automatically when it is accessed again. An active policy processes objects periodically, and a new or changed policy can take up to 24 hours to take effect and start its first run — so blobs that already qualify are not moved the moment you save it.

A worked scenario

Log files are read heavily for a month, occasionally for a quarter, rarely after that, and must be kept one year. One rule filtered on blockBlob and the logs/ prefix does it: after 30 days since modification, tier to cool; after 90 days, tier to archive (on an LRS/GRS/RA-GRS account) with daysAfterLastTierChangeGreaterThan so a log someone rehydrates is left online; after 365 days, delete. Add a version action that deletes previous versions after 30 days if versioning is on. Pair it with blob and container soft delete for human error, and the account manages cost and recovery without scripts.

Tip. Questions are scenarios with one deciding constraint, so read for it: whether data must stay instantly readable or can wait hours for rehydration; whether the account's redundancy allows the archive tier at all; whether a deadline applies to archived data; whether recovered history must outlive a retention window; whether a retention end date is known; and whether a deleted share's snapshots matter. You may also be asked for correct restore steps, a lifecycle prefix or condition, the blob type for an append-only or random-write workload, why an anonymous URL or an NFS mount fails (account setting, firewall, private endpoint), or how SMB traffic can reach a share when port 445 is blocked.

Key takeaways
  • Azure Files gives SMB/NFS shares with file locking that many VMs mount at once; Blob Storage gives HTTPS object storage with optional anonymous read — Azure Files never allows anonymous access.
  • NFS 4.1 needs an SSD (premium) FileStorage account and is secured only at the network level (private endpoint or VNet rule); keys, SAS and Kerberos do not authorize NFS mounts.
  • Transaction optimized, hot and cool exist only on pay-as-you-go standard (HDD) shares and are price options, not speed; moving to SSD means a new FileStorage share and a data copy.
  • Share snapshots restore individual files (Previous Versions on Windows); file share soft delete — on by default, 7 days, 1–365 — restores a deleted share with its snapshots.
  • A port 445 block on the client network is fixed with a VPN or ExpressRoute path to a private endpoint, not with storage firewall rules or service endpoints.
  • Container anonymous access needs Allow Blob anonymous access on the account and still obeys the storage firewall; Blob level allows reads by URL, Container level also allows listing.
  • Time-based retention ends after a set period and, once locked, can only be extended; a legal hold has no end date and lasts until cleared.
  • Archive is offline, needs rehydration (Standard up to 15 hours; High can finish under an hour for blobs under 10 GB) and is only on LRS/GRS/RA-GRS; early-deletion charges are prorated and apply to tier changes too.
  • Soft delete expires after its window and Undelete never promotes a version; versioning keeps every prior state until deleted; container soft delete restores only to the original name.
  • Lifecycle prefixes start with the container name, tiering applies to block blobs only, last-access conditions need access tracking, and new rules can take up to 24 hours to act.

Frequently asked questions

What is the difference between the cool, cold and archive tiers in Azure Blob Storage?

Cool, cold and archive all cost less to store than hot, but cool and cold are online tiers you can read in milliseconds, while archive is offline. Cool has a 30-day minimum retention and cold a 90-day minimum; cold stores more cheaply but charges more per read. Archive is the cheapest to store, has a 180-day minimum, and must be rehydrated before reading, which can take up to 15 hours at Standard priority. Archive is also only available on LRS, GRS and RA-GRS accounts, so on zone-redundant accounts cold is the cheapest option.

How do I recover an accidentally deleted or overwritten blob in Azure?

It depends on which protection was enabled. With blob soft delete and versioning off, run Undelete Blob on a deleted blob; for an overwrite, undelete the soft-deleted snapshot that soft delete kept and copy it over the base blob. With versioning on, copy the previous version you want over the base blob — Undelete never promotes a version to current. Soft-deleted data disappears when its retention period (1 to 365 days) ends, while versions persist until deleted.

What is the difference between blob soft delete and blob versioning?

Blob soft delete is a time-limited safety net: deleted or overwritten data is kept for a retention period you set and then removed permanently. Blob versioning automatically saves every previous state of a blob as a version with its own ID and keeps it until you or a lifecycle rule deletes it. Choose versioning when you need a lasting history of every change, soft delete when you need a recycle bin, and enable both on important data.

Can I restore a deleted blob container?

Yes, if container soft delete was enabled before the deletion and the retention period has not passed. The container is restored with its blobs, but only to its original name, so if a new container with the same name has been created since, you must move any needed data out of it and delete it before the restore succeeds. Container soft delete is separate from blob soft delete, which protects individual blobs in a container that still exists.

What is the difference between a time-based retention policy and a legal hold?

Both are Azure Blob Storage immutability policies that stop blobs from being modified or deleted. A time-based retention policy protects each blob for a set number of days; once the policy is locked it cannot be removed and its period can only be extended. A legal hold has no end date and stays in force until it is cleared, which suits investigations or litigation of unknown length. The two can be applied to the same container at once.

What are the Azure Files access tiers?

Pay-as-you-go standard file shares, which run on HDD in general-purpose v2 accounts, offer three tiers: transaction optimized, hot and cool. They share the same hardware and differ only in price: transaction optimized has the cheapest transactions and the dearest storage, cool the reverse, and hot sits between. Provisioned v2 shares and SSD (premium) shares have no access tiers, and moving data to SSD requires a new share in a FileStorage account and a copy.

How do I recover a deleted Azure file share?

If file share soft delete was enabled — it is on by default for new storage accounts with a 7-day retention — open the account's file shares, show deleted shares and select Undelete. The share returns with its files and its share snapshots, so you can then recover older copies of individual files from those snapshots. Without soft delete, a deleted share cannot be recovered.

What is blob lifecycle management?

Blob lifecycle management is a storage-account policy of rules that tier or delete blobs automatically based on age. Each rule filters blobs by type, by prefixes that start with the container name, or by blob index tags, and runs actions such as tier to cool, cold or archive, or delete, when a blob passes a number of days since modification, creation, last access or last tier change. Tiering applies only to block blobs, last-access conditions require last access time tracking, and a new policy can take up to 24 hours to take effect.

Source

This lesson covers the "Implement and manage storage" domain of the official AZ-104 exam guide. Vendors revise their guides — check the source for the current version.

Test yourself on this topic
Practice now

Sign up free to mark lessons complete, bookmark topics and track your exam readiness.

Spotted a mistake in this lesson?