Domain 2 of 5 · Chapter 1 of 3

Configure access to storage

Two independent checks on every storage data request

An administrator holding the Owner role on the storage account storage1, whose firewall admits only selected networks, opens it in the Azure portal from a machine outside those networks, sees its containers listed, then gets an error on opening a blob. Listing the account is a management operation, while reading the blob is a data operation, and every data operation must clear two independent checks before it runs.

Configuring access to storage sets both checks from the storage account's side: the network check in Storage firewall: virtual network and IP network rules, Resource instance rules and trusted service exceptions and Private endpoints for storage services, and the authorization check, with account access keys, shared access signatures (SAS), stored access policies and identity-based access to Azure Files, in the sections from The two signing authorities to Mount credentials for SMB shares. In the Microsoft AZ-104 study guide skills measured[1], Implement and manage storage also holds Configure and manage storage accounts (creating an account, redundancy, object replication, encryption, Azure Storage Explorer, AzCopy) and Configure Azure Files and Azure Blob Storage (file shares, containers, access tiers, soft delete, versioning, lifecycle management). For the subnet side of the network check, see Configure secure access to virtual networks, sections Service endpoints: enabling the subnet and authorizing it and Creating a private endpoint: placement, subresource and approval.

The two checks

  • Network check. Did the request arrive by an admitted path? A request to the account's public endpoint must come from a source the storage firewall allows. A request through a private endpoint arrives on a separate path that the firewall does not filter.
  • Authorization check. Does the request carry a valid credential for this operation? Azure Storage accepts a Microsoft Entra identity whose Azure RBAC (role-based access control) role grants the data action, a request signed with an account access key (Shared Key authorization), or a SAS token. Blob Storage can also let anonymous read requests proceed when an administrator configures the account and container for anonymous read access[2].

The firewall documentation states the independence directly: clients that make requests from allowed sources must also meet the authorization requirements of the storage account[3], as the figure below traces for one request that is not an anonymous read. The reverse also holds, because a valid credential does not open the firewall. Network rules are enforced on all network protocols for Azure Storage, including REST and SMB[4].

Management operations are outside the firewall

Azure separates operations on the resource (the control plane: Azure Resource Manager calls such as reading account settings) from operations on the data itself (the data plane: reading a blob or a file, for example). Storage firewall rules apply only to data plane operations[4], so tools such as the Azure portal, Azure Storage Explorer and AzCopy reach data only from a machine inside the trusted boundary that the network rules define. Some operations, such as listing blob containers in the portal, can be performed through both the control plane and the data plane[4], which is how the Owner in the opening example saw the containers but could not read the blob: an Owner role assignment grants management authority, not network admission. Nor does Owner pass the authorization check by itself: it does not provide access to data in a storage account via Microsoft Entra ID[2], so from an admitted network the read still needs a data role or a key-based credential (see Account access keys below).

Takeaway: a data request needs both checks, and a management role such as Owner satisfies neither by itself.

Data request (not anonymous)Which endpointdid it arrive at?PrivatePublicPrivate endpoint(no firewall rule)Storage firewall:source allowed?NoRejectedYesAuthorization check:valid credential?YesData operation runsNoRejected
Path of one storage data request that is not an anonymous read: the endpoint, the storage firewall (public endpoint only), then the authorization check

Storage firewall: virtual network and IP network rules

The storage firewall is the set of network rules on the account's public endpoint; two of its rule types identify clients by location. By default, storage accounts allow connections from any network[3]. Once you configure network rules, only traffic from explicitly allowed sources can access your storage account through its public endpoint[3]. The firewall offers four rule types: virtual network rules, IP network rules, resource instance rules and trusted service exceptions. For the last two, see Resource instance rules and trusted service exceptions below.

Turning the rules on

Rules take effect only once the default is to deny. The Azure CLI and PowerShell guidance warns that network rules have no effect unless you set the default action to Deny[5], and that you should grant access to every allowed network (or set up a private endpoint) before you change it. In the portal's Public network access setting, Enabled from selected virtual networks and IP addresses (Enabled from selected networks in the default access how-to[6]) is the counterpart of default action Deny: it allows traffic only from specific virtual networks, IP address ranges or Azure resources that you add[6]. Disabled is a separate property, PublicNetworkAccess, that blocks traffic from all networks, so traffic is allowed only through a private endpoint[6]; exceptions configured earlier still apply (Exceptions outlive a tighter setting in the next section).

Virtual network rules

A virtual network rule admits traffic from one subnet. Two pieces must both exist:

  • a service endpoint for Azure Storage enabled on the subnet, and
  • the subnet listed in the account's virtual network rules.

A service endpoint is not a private endpoint: with service endpoints, DNS entries for Azure services continue to resolve to public IP addresses[7], so the account stays on its public endpoint; only a private endpoint gives it an address inside the virtual network (Private endpoints for storage services below).

The portal creates the service endpoint automatically as you select each target subnet[3]; with PowerShell or the Azure CLI you create it with a separate command. Azure offers two storage service endpoint types[3]: Microsoft.Storage connects to accounts in the same region as the virtual network, and Microsoft.Storage.Global connects to accounts in any region. A subnet can carry only one of the two at a time; to switch, delete the existing one first. Each account accepts up to 400 virtual network rules[3], and the subnet can belong to any subscription or Microsoft Entra tenant. A subnet in another tenant must be added with PowerShell, the Azure CLI or the REST API, because the portal shows only virtual networks in the same tenant[5].

A rule names a specific subnet, so peering another virtual network to an allowed one admits nothing: the peered subnet has neither its own service endpoint nor its own rule. Likewise, if you delete an allowed subnet and create a new one with the same name, the new subnet has no access[4] until you authorize it explicitly.

Azure CLI: allow one subnet, then deny everything else

This listing applies the two pieces above to subnet app in vnet1, then changes the default action last so that the subnet is allowed before anything is blocked. The commands follow the virtual network rule how-to[5].

# Service endpoint on the subnet (cross-region variant)
az network vnet subnet update --resource-group rg1 --vnet-name vnet1 \
  --name app --service-endpoints Microsoft.Storage.Global

# Add the subnet to the account's virtual network rules
subnetid=$(az network vnet subnet show --resource-group rg1 --vnet-name vnet1 \
  --name app --query id --output tsv)
az storage account network-rule add --resource-group rg1 \
  --account-name storage1 --subnet $subnetid

# Deny every source that no rule allows
az storage account update --resource-group rg1 --name storage1 --default-action Deny

IP network rules

An IP network rule admits a range of public IPv4 addresses, for clients that are not in an Azure virtual network. The firewall evaluates the address Azure actually sees, so for an on-premises client you allow the internet-facing IP addresses that your network uses[3], not the host's private address. With Azure ExpressRoute Microsoft peering, you allow the NAT (network address translation) IP addresses used for that peering. The restrictions for IP network rules[4] are strict:

  • Private ranges from RFC 1918 (addresses that start with 10, 172.16 to 172.31, and 192.168) are not allowed.
  • Only IPv4 is supported.
  • Ranges use CIDR notation such as 16.17.18.0/24, but /31 and /32 prefixes are not supported; enter those addresses as individual IP address rules.
  • Each account supports up to 400 IP network rules[3].

Same-region clients need virtual network rules

Services deployed in the same region as the storage account use private Azure IP addresses[4], so allowing a same-region service's documented public outbound range does nothing, and IP network rules have no effect on requests that originate from the same Azure region[4]. A service endpoint changes the source address the same way: traffic from that subnet then uses a private IP address as its source, so IP network rules that permit traffic from that subnet no longer have an effect[3]. For an eligible client in the storage account's Azure region, the virtual network rule is the tool; IP rules cannot restrict same-region Azure traffic.

Takeaway: a virtual network rule identifies a subnet (service endpoint plus rule), an IP rule identifies a public egress address, and neither restricts anything until the default action is Deny.

Resource instance rules and trusted service exceptions

Some Azure workloads cannot be described by a subnet or a public IP address, and this section covers the two rule types that admit them by identity instead of location.

Resource instance rules

A resource instance network rule[3] admits one specific Azure resource instance that you can't isolate through a virtual network rule or an IP rule. The rule only opens the network check: the Azure role assignments of the resource instance determine the types of operations that it can perform on storage account data[3]. The instance must be from the same tenant as the storage account, but can belong to any subscription within the tenant[3].

Trusted service exceptions

A network security exception[3] admits traffic from Azure services that operate from networks you cannot include in your rules, for example a service that reads the account's resource logs and metrics. These services connect with strong authentication. The portal option Allow Azure services on the trusted services list to access this storage account covers only the services on Microsoft's published trusted services list; it is not a blanket allowance for every application hosted in Azure. An ordinary application that you run in Azure still needs a virtual network rule, an IP rule, a resource instance rule or a private endpoint.

Exceptions outlive a tighter setting

Access from trusted services takes the highest precedence over other network access restrictions[4]. If you change Public network access from Enabled from selected virtual networks and IP addresses to Disabled, any resource instance rules and exceptions you configured earlier remain in effect, so those resources and services might still reach the account. When you tighten isolation, review and remove the exceptions you no longer want rather than assuming that Disabled clears them.

A reporting quirk follows from the same settings. Disabling public access through a template can leave the defaultAction property at Allow, and Microsoft Defender for Storage or Azure Advisor may then still recommend restricting access; the fix is to set defaultAction to Deny in the template, or disable public access with the portal, PowerShell or the Azure CLI, which change it to Deny for you[4].

Takeaway: both rule types widen the network check for named Azure workloads, and neither replaces the authorization check.

Private endpoints for storage services

A private endpoint is the other network path into a storage account, and this section covers when to use one and the DNS behavior that makes it work. A private endpoint is a special network interface for an Azure service in your virtual network[8], with an IP address from the virtual network's address range; traffic between the clients and the account then travels over the virtual network and Azure Private Link on the Microsoft backbone network. Private endpoints are not available for general-purpose v1 storage accounts[8]. For the subnet side of a private endpoint, see Configure secure access to virtual networks, section Creating a private endpoint: placement, subresource and approval.

One endpoint per storage service

A private endpoint targets one target sub-resource of the account, not the whole account: you need a separate private endpoint for each storage resource that you need to access[8], namely blob, dfs (Data Lake Storage), file, queue, table or web (static websites). A blob endpoint therefore does nothing for an SMB client mapping a file share, which needs a file endpoint. For Data Lake Storage workloads, create endpoints for both the dfs and blob resources[8], because operations sent to the Data Lake Storage endpoint can be redirected to the blob endpoint, and operations such as creating directories or managing ACLs fail without a dfs endpoint.

Creation, approval and the public endpoint

Creating a private endpoint sends a consent request for approval to the storage account owner[8]; if the requester also owns the account, the request is approved automatically. The endpoint does not close the public path: creating a private link does not automatically block connections on the public endpoint[8]. For private-only access, also close the public endpoint (the settings are compared in Turning the rules on above): either set Public network access to Disabled, which blocks traffic from all networks, so traffic is allowed only through a private endpoint[6], or set the default action to Deny with no rule for public sources, since then only traffic from explicitly allowed sources can access your storage account through its public endpoint[3]. The private path keeps working either way, because traffic from the associated virtual network is always allowed, even if public network access is disabled[8], and it needs no firewall rule. On-premises clients can use the endpoint through a VPN or ExpressRoute private peering[8] into that virtual network.

Same hostname, different answer

Clients keep the same connection string[8] that they would use for the public endpoint, and Microsoft warns not to connect with the privatelink subdomain URL. DNS does the redirection. Creating the endpoint turns the account's DNS record into a CNAME (alias) that points to a name under privatelink, and a private DNS zone for that subdomain holds an A record with the private endpoint's address. A client inside the virtual network therefore resolves the normal name to the private IP address (Microsoft's example uses 10.1.1.5), while a client outside resolves the same name to the public endpoint, where the storage firewall applies. The figure below traces both lookups.

The recommended private DNS zone names[8] follow the target sub-resource:

Storage service Target sub-resource Private DNS zone
Blob Storage blob privatelink.blob.core.windows.net
Data Lake Storage dfs privatelink.dfs.core.windows.net
Azure Files file privatelink.file.core.windows.net
Queue Storage queue privatelink.queue.core.windows.net
Table Storage table privatelink.table.core.windows.net
Static websites web privatelink.web.core.windows.net

With a custom or on-premises DNS server, make that server resolve the privatelink name to the private address, either by delegating the subdomain to the private DNS zone or by adding the A records yourself.

Not the same as a service endpoint

As Virtual network rules in Storage firewall: virtual network and IP network rules above explains, a service endpoint leaves the account on its public endpoint, because with service endpoints, DNS entries for Azure services continue to resolve to public IP addresses[7]; only a private endpoint gives the storage service an IP address inside your virtual network.

Takeaway: create one private endpoint per storage service, let DNS resolve the normal hostname privately, and close the public endpoint as a separate step.

Client looks upstorage1.blob.core.windows.netCNAMEstorage1.privatelink.blob.core.windows.netResolved from theVNet with theprivate endpoint?YesNoPrivate DNS zone:A record 10.1.1.5(private endpoint)Public DNS:public endpoint IP(storage firewall)
DNS lookup of a storage blob hostname from inside and outside the virtual network that hosts the private endpoint

The two signing authorities

SAS signing traces back to one of two authorities. By default, requests can be authorized with either Microsoft Entra credentials or the account access key for Shared Key authorization[2]. A shared access signature (SAS), a signed token appended to a resource URL that delegates limited access (its anatomy is in Anatomy of a SAS token below), is signed by one of the same two authorities:

Credential Signed or authorized by
Microsoft Entra identity with an Azure RBAC data role Microsoft Entra ID
Request signed with an account key Shared Key
User delegation SAS Microsoft Entra ID (through a user delegation key)
Service SAS Shared Key
Account SAS Shared Key

The SAS overview[9] gives the three SAS rows and separates the types: a service SAS reaches resources in one storage service, an account SAS reaches one or more services, and a user delegation SAS is signed with a user delegation key obtained with Microsoft Entra credentials (The three SAS types below compares them in full). The signing authority helps identify a revocation route, which is why this table returns in What each revocation action invalidates below.

Account access keys

The Shared Key authority from The two signing authorities above rests on two account access keys.

What a key unlocks

When you create a storage account, Azure generates two 512-bit storage account access keys[10], called key1 (the primary key) and key2 (the secondary key) in the portal, PowerShell and the Azure CLI alike. Either key authorizes Shared Key access to data and can sign service and account SAS tokens, and Microsoft states the consequence plainly: access to the shared key grants a user full access to a storage account's data[10]. Treat the right to read keys as the right to read data.

Reading and regenerating keys are management actions with their own permissions:

Operation Required action Built-in roles that include it
View (list) keys Microsoft.Storage/storageAccounts/listkeys/action Owner, Contributor, Storage Account Key Operator Service Role
Regenerate keys Microsoft.Storage/storageAccounts/regeneratekey/action Owner, Contributor, Storage Account Key Operator Service Role

The table comes from the key management guide[10]. The Storage Account Key Operator Service Role[11] contains exactly those two actions and nothing else, so it delegates key listing and rotation without general resource administration. The blob data roles work the other way round: Storage Blob Data Reader grants blob data actions but neither key action, so it cannot delegate key rotation. Meanwhile, management roles such as Owner, Contributor and Storage Account Contributor do not provide data access through Microsoft Entra ID, but include listkeys/action, which lets the holder use the keys to access all data in the account[2].

Handling keys

Microsoft recommends Microsoft Entra ID with managed identities to authorize requests whenever possible[10], and when keys are unavoidable, storing them in Azure Key Vault and rotating them regularly[10], in the order that Rotating account keys below sets out.

Takeaway: an account key is a whole-account data credential, so who can list keys matters as much as who holds a data role.

Anatomy of a SAS token

A shared access signature (SAS) is the credential you hand to a client that has no permissions of its own, and this section covers what the token contains and how to keep it narrow. A SAS is a token appended to the URI for an Azure Storage resource[9]: a set of query parameters stating what the holder may do, plus a signature computed from those parameters with the signing key. Azure Storage checks the parameters and the signature on each request; if the signature is valid the request is authorized, and otherwise it is declined with error code 403 (Forbidden)[9].

Example: a read-only blob SAS URL (version and signature shortened)

https://storage1.blob.core.windows.net/reports/q3.pdf?sv=...&sr=b&sp=r&st=2026-11-01T08:45:00Z&se=2026-11-01T17:00:00Z&spr=https&sip=203.0.113.10&sig=...

Everything after the ? is the SAS token. The fields this topic reasons about are:

Field Meaning
sv Signed version: the storage service version used to authorize the request
sr Signed resource, for example b for a blob, c for a container
sp Signed permissions, for example r read, w write, d delete, l list
st / se Signed start and signed expiry, in UTC
spr Signed protocol: https only, or https,http
sip Signed IP: one IPv4 address or a range allowed to use the token
sig The signature that proves the token was signed with a valid key

The field meanings come from the account SAS reference[12] and the user delegation SAS examples[13]. The ? delimiter is not part of the SAS token[9]: the portal, PowerShell, the Azure CLI and the SDKs can return the token without it, so append it yourself when you build the URL.

Possession is authorization

An ordinary SAS works for whoever holds it: if a SAS is leaked, it can be used by anyone who obtains it[9], and Microsoft says to protect a SAS just as you would protect an account key[12]. So scope every token to the smallest resource, the fewest permissions and the shortest validity the task needs; if a partner needs to read one file, grant read access to that single object[9], not read and write on the whole container. Create and distribute SAS URLs only over HTTPS, and set spr=https so that the token cannot be used over HTTP; the default is https,http, and HTTP alone is not a permitted value[12].

Address and clock restrictions

sip narrows who can use a token, but it cannot widen the network check from Two independent checks on every storage data request above: SAS tokens that grant access to a specific IP address limit the token holder's access, but they don't grant new access beyond configured network rules[3]. Leave sip off a SAS used by a client in the account's own Azure region, because requests made from within the same region with a SAS that specifies an outbound IP address will fail[12].

Machines disagree slightly about the current time (clock skew). Setting st to the current moment can cause intermittent failures, so Microsoft's guidance is to set the start time at least 15 minutes in the past, or not set it at all, which makes the SAS valid immediately[9], and to allow for up to 15 minutes of skew at expiry as well. On an account with a SAS expiration policy, a SAS without st is out of policy[14]: where the expiration action applies, requests are allowed under Log and denied under Block, as SAS expiration policy: Log or Block below explains (the token types it does not apply to are listed under Boundaries there).

Nothing tracks issued tokens

A SAS is generated on the client side, and the SAS token is not tracked by Azure Storage in any way[9]: no API can count the shared access signatures generated for an account[9], and it's not possible to audit the generation of SAS tokens[9]. Requests that use a token can be logged, but there is no service registry from which to find and delete one token. Decide the expiry, keep your own issuance records if you need them, and choose a revocation route before you hand a token out; the routes depend on how the token was signed, as What each revocation action invalidates below shows.

Takeaway: an ordinary SAS is a bearer credential, so keep its scope, permissions, protocol and lifetime narrow rather than treating possession as safe.

The three SAS types

Azure Storage issues three kinds of SAS, and this section covers how to pick one before the next sections detail the account SAS and the user delegation SAS. All three share the anatomy from the previous section; they differ in who signs them and how far they reach (SAS overview[9]):

SAS type Signed with Reach Stored access policy
User delegation SAS A user delegation key obtained with Microsoft Entra credentials Only what the signer's own data permissions also allow Not supported
Service SAS The account key Resources in one storage service (Blob, Queue, Table or Azure Files) Optional
Account SAS The account key Resources in one or more services, plus service-level operations Not supported

When each type fits

Ad hoc or policy-linked

Any SAS can be an ad hoc SAS, which carries its start time, expiry time and permissions in its own URI. Only a service SAS can instead inherit those constraints from a stored access policy[9]; a user delegation SAS or an account SAS must be an ad hoc SAS[9]. That one rule settles many design questions: if you need to change or revoke a group of tokens through a stored access policy, the tokens must be service SAS tokens linked to a policy (see Stored access policies below), and a multi-service token can never have policy-linked revocation.

Takeaway: choose a user delegation SAS by default, an account SAS for multi-service or service-level reach, and a service SAS when you need a stored access policy.

Account SAS: services, resource types and permissions

An account SAS answers three separate questions in three fields, and a request succeeds only when all three allow it; this section covers how they combine. The fields are defined in the account SAS reference[12]:

Field Selects Values
ss (signed services) Which services the token reaches b Blob, f Files, q Queue, t Table
srt (signed resource types) Which level of API the token reaches s service (for example Get/Set Service Properties, List Containers), c container (for example Create/Delete Container, List Blobs), o object (for example Put Blob, Get Messages)
sp (signed permissions) Which operations are allowed r read, w write, d delete, l list, a add, c create, u update, p process, among others

The permissions are not free-floating: permissions are valid only if they match the specified signed resource type; if they don't match, they're ignored[12]. List (l), for example, is valid for the service and container resource types only[12].

Worked case

A reporting tool needs to read blobs and list the blobs inside the containers of storage1, and nothing else. The token needs ss=b (Blob only), srt=co (container-level calls to list blobs, object-level calls to read them) and sp=rl. It cannot list the account's containers, because List Containers is a service-level call: that would need s in srt as well as l in sp.

Azure CLI: Blob-only account SAS for reading and listing blobs

This is the worked case above as a command; the token it prints carries ss=b, srt=co and sp=rl.

# The account key comes from the AZURE_STORAGE_KEY environment variable,
# set from a secure store such as Key Vault, never typed on the command line.
expiry="2026-11-01T17:00Z"   # UTC; keep it near-term
az storage account generate-sas \
  --account-name storage1 \
  --services b \
  --resource-types co \
  --permissions rl \
  --expiry "$expiry" \
  --https-only \
  -o tsv

The command reference[15] documents --services, --resource-types and --permissions with the same letters, reads the key from the AZURE_STORAGE_KEY environment variable when --account-key is omitted, and --https-only permits only HTTPS requests.

The same reasoning explains a classic wrong answer. Delegating a change to Blob service properties needs an account SAS with s in srt, so az storage container generate-sas, which produces a container-level service SAS, cannot do it. Reaching several services is a separate matter of ss: you can combine values to provide access to more than one service[12], so a Blob and Queue token needs ss=bq but no s in srt unless it also calls service-level operations.

Takeaway: read an account SAS request as service, then resource type, then permission, and require all three to match.

User delegation SAS: signer rights, lifetime and revocation

A user delegation SAS replaces the account key with a Microsoft Entra identity. For Blob Storage, the service the commands below document, an administrator decides who may sign one, how long it lives and how to revoke it.

How the signing works

The signer (a Microsoft Entra user, service principal or managed identity) signs in to Microsoft Entra ID and calls the Get User Delegation Key operation. Azure Storage returns a user delegation key, and the signer uses that key, instead of an account key, to sign the SAS. When a client later presents the SAS, the permissions it receives are the intersection of the permissions granted to the security principal that requested the user delegation key and the permissions granted on the token's sp field[16]. The figure below shows the four steps.

Who may sign: the role must sit at account scope or above

For a Blob Storage user delegation SAS, requesting the key requires the action Microsoft.Storage/storageAccounts/blobServices/generateUserDelegationKey/action. Because the operation acts at the level of the storage account, the role that provides this action must be assigned at the level of the storage account, the resource group or the subscription[13]. Built-in roles that include it are Contributor, Storage Account Contributor, Storage Blob Data Contributor, Storage Blob Data Owner, Storage Blob Data Reader and Storage Blob Delegator, among others[16].

This creates a predictable failure. A signer who holds Storage Blob Data Reader only on container reports can read those blobs but cannot request a delegation key, because a container-scoped assignment cannot authorize an account-level operation. Two fixes exist, and only one keeps least privilege:

With the second fix, each assignment supplies a different required permission. Another data grant can count: POSIX access control list (ACL) permissions, which are checked only when RBAC permissions can't grant access, and only when hierarchical namespace is enabled on the storage account[16]. Hierarchical namespace is the Azure Data Lake Storage capability that organizes the objects and files within a storage account into a hierarchy of directories and nested subdirectories[17], whose directories and files carry POSIX ACLs: Data Lake Storage supports POSIX access control lists, with permissions set at the directory or file level[17] (see Hierarchical namespace in Configure and manage storage accounts). Assuming no other data grants, ACL grants included, the Delegator assignment alone lets the signer request a key, but every SAS it signed would carry no data rights, because the intersection with zero data permissions is empty. The container-scoped Reader alone supplies data rights on reports but no key. Together, the signer can issue read tokens for reports and for nothing else, and a token that asks for write (sp=rw) still yields read only, because the signer holds no write permission.

Azure CLI: user delegation SAS for one blob

The signer runs this while signed in to the Azure CLI with a Microsoft Entra account. --auth-mode login and --as-user are required to create a user delegation SAS[13], and --full-uri returns the blob URL with the token appended.

az storage blob generate-sas \
  --account-name storage1 \
  --container-name reports \
  --name q3.pdf \
  --permissions r \
  --expiry 2026-11-05T17:00Z \
  --auth-mode login \
  --as-user \
  --full-uri

For a whole container, az storage container generate-sas takes the same --auth-mode login --as-user pair.

Lifetime: seven days at most

The Azure CLI creates the user delegation key implicitly and gives it the start and expiry of the SAS. The user delegation key is valid for at most 7 days from the start date, and the SAS is invalid after the key expires[13], so request a SAS expiry within that limit, not 30 days out. For longer access, have the issuing service sign a fresh token before the old one expires.

Revocation

az storage account revoke-delegation-keys --name storage1 --resource-group rg1 revokes all of the user delegation keys associated with the storage account, and any shared access signatures associated with those keys are invalidated[13]. It is all-or-nothing for the account, and because Azure Storage caches both the user delegation key and Azure role assignments, there may be a delay[13] before an existing token stops working.

Takeaway: the signer needs key-generation rights at account scope or above plus data rights on the target, the token lives at most seven days, and revocation clears every user delegation SAS on the account.

1. Signer signs in toMicrosoft Entra ID2. Get user delegation key(role at account scope or above)3. Sign the SAS with that key(valid for at most 7 days)4. Client uses the SAS:allowed only where the SASand the signer both permit
User delegation SAS: Microsoft Entra sign-in, the delegation key, the signed token, and the permission intersection when a client uses it

SAS expiration policy: Log or Block

Because Azure Storage keeps no list of issued tokens (see Anatomy of a SAS token above), the account-level control over SAS lifetimes is the SAS expiration policy, and this section covers how it measures a token and what its two actions do.

The policy sets an upper limit on the validity interval of a user delegation SAS, a service SAS or an account SAS[14]. The validity interval is the signed expiry minus the signed start, and a token at or under the limit complies. A token is out of policy when it does not have a signed start or has a validity interval larger than the upper limit[14]. That is why the earlier advice to omit st does not apply on an account with this policy: set st at least 15 minutes in the past instead. Anyone who creates a token longer than the limit also sees a warning with the recommended maximum.

The two actions

Action Out-of-policy request Use it to
Log (default) Allowed; with a diagnostic setting that sends logs to Azure Monitor, the SasExpiryStatus property records the violation Find long-lived tokens without breaking clients
Block Denied Enforce a mandatory maximum lifetime

The expiration policy guide[14] recommends starting with Log to watch for violations, and strongly recommends Block to stop out-of-policy tokens. A requirement that tokens must not exceed a lifetime is therefore a Block requirement, because Log only records.

Azure PowerShell: a one-day limit, enforced

# The interval format is <days>.<hours>:<minutes>:<seconds>
Set-AzStorageAccount -ResourceGroupName rg1 -Name storage1 `
  -SasExpirationPeriod 1.00:00:00 -SasExpirationAction Block

KQL: count policy violations in Log mode

This query runs in the Log Analytics workspace that receives the account's blob logs, and pairs with a Log-mode policy.

StorageBlobLogs
| where SasExpiryStatus startswith "Policy violated"
| summarize count() by AccountName, SasExpiryStatus

Boundaries

Takeaway: the expiration policy is the account-wide ceiling on SAS lifetimes, and only its Block action enforces that ceiling.

Stored access policies

A stored access policy lets you change or revoke service SAS tokens after you have handed them out, and this section covers where policies live, how they combine with a token, and their limits. A stored access policy[18] is defined on a blob container, file share, queue or table, and groups the service SAS tokens that reference it by its signed identifier. A policy on a container can govern a SAS for the container itself or for the blobs it contains; a policy on a file share likewise covers the share or its files. Stored access policies are not supported for the user delegation SAS or the account SAS[18], and there is no storage-account-wide policy.

Splitting parameters between token and policy

A policy can hold the start time, expiry time and permissions; the token can hold them instead, or the two can split them. The one rule is that you can't specify a parameter on both the SAS token and the stored access policy[18], so you cannot repeat the expiry in both places for safety. Put on the policy whatever you may want to change later, because a value fixed inside a distributed token cannot be changed.

Changing and revoking a group

These changes immediately affect all of the shared access signatures associated with the policy[18], and nothing else, so ad hoc tokens and tokens linked to other policies keep working. To revoke one partner without touching another, give each partner its own policy. Regenerating the account key instead would revoke every SAS signed with that key at once (see What each revocation action invalidates below).

The figure below shows two partner policies on container reports: partner-a (read only) and partner-b (read and write). Deleting partner-a revokes its two tokens, while the tokens linked to partner-b keep working.

Limits that shape the design

  • At most five access policies[18] can exist on one container, table, queue or share at a time; trying to set more returns 400 (Bad Request). One policy can serve any number of tokens, so plan independent revocation groups within five.
  • A new or updated policy might take up to 30 seconds to take effect[18], and during that interval requests with linked tokens can fail with 403 (Forbidden).

Azure CLI: a read-only policy and a token linked to it

This creates the partner-a policy from the figure and issues one token that inherits its permissions and expiry.

# Policy partner-a on container reports holds the permissions and the expiry
az storage container policy create --account-name storage1 \
  --container-name reports --name partner-a \
  --permissions r --expiry 2026-12-31T00:00:00Z

# The token names the policy and carries no permissions or expiry of its own
az storage container generate-sas --account-name storage1 \
  --name reports --policy-name partner-a -o tsv

Both commands work with the account key, because a service SAS is key-signed: policy create[19] and container generate-sas[20] take it from --account-key or the AZURE_STORAGE_KEY environment variable, or query it with your Azure sign-in when neither is present.

Takeaway: stored access policies give service SAS tokens a server-side handle, at most five per container, that you edit or delete to change a whole group at once.

Container: reportsPolicy partner-a(read only)Policy partner-b(read and write)SAS 1SAS 2SAS 3SAS 4Delete partner-a:SAS 1 and SAS 2 stop working;SAS 3 and SAS 4 keep workingAt most five policies per container
Two stored access policies on container reports, each grouping service SAS tokens, and the effect of deleting one policy

Rotating account keys

Azure gives every account two keys so that you can replace one while clients use the other, and this section covers the rotation order, the commands and the rotation reminder. Having two keys ensures that your application maintains access to Azure Storage throughout the process[10].

The rotation order

The order below follows the manual rotation procedure[10], and the figure below shows the same four steps.

  1. Switch every client's connection string to key2, the key you are not rotating yet.
  2. Regenerate key1. Its old value stops working, together with any service or account SAS signed with it.
  3. Switch the clients to the new key1.
  4. Regenerate key2 the same way.

The order matters because regeneration takes effect immediately: regenerating the key that applications still reference cuts them off until their connection strings change. This is also why Microsoft recommends using only one of the keys in all of your applications at the same time[10]; if some applications use key1 and others key2, neither key can be rotated without some application losing access.

Regeneration is its own command, distinct from listing the keys:

Tool Regenerate a key List keys (does not rotate)
Azure PowerShell New-AzStorageAccountKey -ResourceGroupName rg1 -Name storage1 -KeyName key1 (or key2) Get-AzStorageAccountKey
Azure CLI az storage account keys renew --resource-group rg1 --account-name storage1 --key primary (or secondary) az storage account keys list

The commands come from the key management guide[10], which also recommends Azure Key Vault to manage and rotate keys without interrupting applications.

The key expiration policy is a reminder

A key expiration policy lets you set a reminder for the rotation of the account access keys[10]: the reminder is displayed if the interval has elapsed and the keys have not been rotated, and Azure Policy can then report accounts that are out of compliance. The policy does not regenerate keys or update any client; an administrator still performs the rotation above. Older accounts can have a null KeyCreationTime for a key, and if it is null, you cannot create a key expiration policy until you rotate the keys[10]. The interval is set in days.

Azure PowerShell and Azure CLI: a 60-day rotation reminder

Set-AzStorageAccount -ResourceGroupName rg1 -Name storage1 -KeyExpirationPeriodInDay 60
az storage account update --resource-group rg1 --name storage1 --key-exp-days 60

Takeaway: move clients off a key before you regenerate it, keep all clients on one key at a time, and treat the expiration policy as a reminder, not automation.

1. Switch clients to key2(key1 still valid)2. Regenerate key1(old key1 stops working)3. Switch clients to new key1(key2 still valid)4. Regenerate key2(old key2 stops working)
Four-step rotation of the two storage account access keys without cutting off clients

What each revocation action invalidates

Revoking access in Azure Storage means picking the action whose reach matches the credentials you want gone, and this section covers the four actions side by side. Each one follows the signing authority from The two signing authorities above: an action on a key affects what that key signed, and an action on Microsoft Entra delegation affects what Microsoft Entra delegation signed.

Action Stops working Keeps working
Regenerate key1 Clients using key1; service and account SAS signed with key1 Clients using key2; SAS signed with key2; every user delegation SAS
Disallow Shared Key (AllowSharedKeyAccess set to false) Every request authorized with either account key; every service SAS and account SAS Microsoft Entra-authorized requests; user delegation SAS for Blob Storage; configured anonymous blob reads
Revoke user delegation keys Every user delegation SAS on the account, after a caching delay Key-signed SAS; Microsoft Entra-authorized requests
Delete a stored access policy, change its identifier, or move its expiry into the past Service SAS tokens linked to that policy Everything else, including ad hoc service SAS

The rows draw on the guidance for regenerating keys[10], disallowing Shared Key[2], revoking delegation keys[13] and stored access policies[18]. Key regeneration in particular revokes the SAS tokens generated from that key, while user delegation SAS tokens are not affected by key rotation[10].

Disallowing Shared Key in detail

When you set the account's AllowSharedKeyAccess property to false, Azure Storage rejects all subsequent requests to that account that are authorized with the account access keys[2]. The property is not set by default, and the account permits Shared Key when the value is null or true[2], so an account nobody has changed still allows it. Because a service SAS and an account SAS are themselves Shared Key credentials, requests with either are denied for all Azure Storage services[2], while a user delegation SAS for Blob Storage is permitted. The SAS overview lists user delegation SAS for Queue Storage, Table Storage and Azure Files as well (The three SAS types above), but the Shared Key guidance lists the user delegation SAS row as Blob Storage only[2], so it confirms only the Blob case. Replacing a disallowed key connection with an account SAS therefore fails too. Anonymous access is a separate setting: anonymous requests aren't authorized and proceed if you configured the account and container for anonymous read access[2], so disallowing Shared Key does not switch them off.

Azure CLI: disallow Shared Key authorization

az storage account update --resource-group rg1 --name storage1 --allow-shared-key-access false

Three consequences shape the decision. First, the Azure portal uses Shared Key authorization to access Azure file shares by default[2], so file access fails after the change unless the right RBAC assignments are in place. Second, protecting an account with Microsoft Entra Conditional Access policies requires disallowing Shared Key[2]. Third, Microsoft recommends migrating clients that use Shared Key to Microsoft Entra ID before you disallow it[2].

Takeaway: regenerate a key to invalidate what that key signed, disallow Shared Key to invalidate everything key-signed, revoke delegation keys to invalidate every user delegation SAS, and edit a stored access policy to invalidate one group.

Choosing an identity source for Azure Files

SMB (Server Message Block) file shares can authenticate each user with a directory identity instead of the account key, and this section covers the three identity sources and how to choose between them. Identity-based access uses the Kerberos protocol[21]: the client obtains a Kerberos ticket from the identity source and presents it, and the Azure Files service only receives the Kerberos ticket, not the user's access credentials[21]. All three sources require Kerberos to be enabled under Authentication methods in the account's SMB security settings[21]. NFS (Network File System) shares sit outside this model: Azure Files doesn't support identity-based authentication for NFS file shares[21], which use host-based authentication[22] instead.

The three sources

The two Microsoft Entra names below are not the Microsoft Entra ID directory itself. Microsoft Entra Domain Services is a managed domain whose clients join it and need connectivity to its domain controllers[21], and the platform manages user synchronization from Microsoft Entra ID to Microsoft Entra Domain Services[21]; with Microsoft Entra Kerberos, Microsoft Entra ID issues the Kerberos tickets[21] itself.

Identity source Best fit Identities and clients Key requirement
AD DS (on-premises Active Directory Domain Services) An existing AD DS domain whose domain controllers the clients can reach AD DS users on Windows and Linux Clients reach the domain controllers; identities synced to Microsoft Entra ID for user- and group-specific share permissions
Microsoft Entra Domain Services An existing or needed managed domain in Azure Cloud-only or hybrid identities on Windows and Linux Clients joined to the managed domain, with connectivity to its domain controllers
Microsoft Entra Kerberos Cloud-first or hybrid environments, Microsoft Entra joined clients, clients without domain controller connectivity Hybrid or cloud-only identities on Windows, and macOS in preview; Linux user authentication isn't supported The storage account's application excluded from multifactor authentication (MFA) policies

The table condenses Microsoft's identity source comparison[21].

One source per account

You can use only one identity source for file access authentication per storage account, and it applies to all file shares in the account[21]. You cannot run AD DS for one share and Microsoft Entra Domain Services for another in the same account; place shares that need different sources in separate accounts. The source can be changed later, but changing the identity source temporarily interrupts identity-based access to all file shares in the storage account[21].

Deciding by constraint

Three constraints eliminate sources, and the figure below applies them in order:

For applications and Azure compute workloads that need keyless SMB access, a managed identity is separate from the three user identity sources and can coexist with user identity-based authentication on the same storage account[21].

Takeaway: pick one identity source per account by three constraints, in order: Linux users, domain controller reachability, and an existing domain.

Linux userclients?YesAD DS, orMicrosoft EntraDomain ServicesNoClients reach adomain controller?NoMicrosoft EntraKerberosYesExisting AD DSdomain to keep?YesAD DSNoMicrosoft Entra Kerberos,or Microsoft EntraDomain Services
Choosing the Azure Files identity source by three constraints: Linux users, domain controller reachability, and an existing domain

Enabling the identity source

Choosing a source is half the work, and this section covers what each source needs before any share permission can take effect. After a source is enabled, Microsoft's sequence continues with assigning share-level permissions, configuring file and directory permissions, configuring network access and DNS, and then preparing the clients and mounting the share[21]; the following sections cover the permission and mount steps.

AD DS

AD DS must know the storage account as a domain member. You register the storage account with your on-premises AD DS by creating a computer account (or service logon account) that represents it, and then set the required domain properties on the storage account[23]. The recommended tool is the AzFilesHybrid PowerShell module, whose Join-AzStorageAccount cmdlet performs the equivalent of an offline domain join for the storage account[23] and enables the feature; a manual procedure exists for environments that cannot use the module. Assigning a share role such as Storage File Data SMB Share Contributor to domain users enables nothing by itself, because without the registration the storage account has no identity in the domain.

Azure PowerShell: confirm AD DS is the account's identity source

Run this after Join-AzStorageAccount (or the manual steps) and before assigning share permissions; the property names come from the AD DS enablement guide[23].

$storageAccount = Get-AzStorageAccount -ResourceGroupName rg1 -Name storage1
# Lists the identity source for the account
$storageAccount.AzureFilesIdentityBasedAuth.DirectoryServiceOptions
# Lists the domain information (domain name, forest, GUID, SIDs)
$storageAccount.AzureFilesIdentityBasedAuth.ActiveDirectoryProperties

For direct per-identity share-level RBAC assignments, AD DS identities need a Microsoft Entra counterpart: sync the on-premises AD DS to Microsoft Entra ID by using Microsoft Entra Connect Sync or Microsoft Entra Connect cloud sync[21], because those share-level permissions are configured against the identity in Microsoft Entra ID while file and directory permissions are enforced against the identity in AD DS. Successful domain authentication alone grants no share access.

Microsoft Entra Domain Services

Join the client virtual machines to the managed domain[21]; they need network connectivity to it. Enablement creates the storage account identity automatically[21], and all Microsoft Entra users, cloud-only or hybrid, can authenticate.

Microsoft Entra Kerberos

The standard flow has three preparation items, all from the Microsoft Entra Kerberos enablement guide[24]:

Takeaway: AD DS needs the storage account registered in the domain, Microsoft Entra Domain Services needs domain-joined clients, and Microsoft Entra Kerberos needs joined clients, synced hybrid identities and an MFA exclusion.

Share-level permissions and Windows ACLs

Once a user authenticates, two permission layers decide what they can do, and this section covers both layers and how they combine. Share-level permissions are Azure RBAC role assignments (or a default share-level permission) that act as a high-level gatekeeper that determines whether a user can access the share[26]. Windows ACLs (access control lists, also called NTFS permissions) then control the operations on individual directories and files. When a user tries to access a file or directory, share-level, file-level and directory-level permissions are enforced, and if they differ, only the most restrictive one applies[26]. The figure below shows the order.

The share-level roles

The roles that grant ordinary share-level access form a ladder (share-level permission guide[27]):

Role Grants
Storage File Data SMB Share Reader Read access to files and directories
Storage File Data SMB Share Contributor Read, write and delete
Storage File Data SMB Share Elevated Contributor Read, write, delete and modify ACLs

Other Azure Files roles behave differently and are not rungs on this ladder: Storage File Data Privileged Reader and Storage File Data Privileged Contributor work by overriding existing ACLs[27], and Storage File Data SMB Admin is covered in the next section. Assign the role at the file share's own scope when it must not reach sibling shares.

Role assignment scope for a single file share (values in angle brackets are placeholders)

/subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/Microsoft.Storage/storageAccounts/<storage-account>/fileServices/default/fileshares/<share-name>

For hybrid users, assign the role to the synced Microsoft Entra identity: an AD user user1@onprem.contoso.com synced to Microsoft Entra ID as user1@contoso.com needs the share-level permission assigned to user1@contoso.com[27]. Share-level permission changes usually take effect within 30 minutes[27].

Most restrictive wins

The intersection rule cuts both ways, as rows from Microsoft's permission matrix[26] show:

Share-level role Windows ACL Effective access
SMB Share Reader Modify Read
SMB Share Contributor Read Read
SMB Share Contributor Modify Read, write, delete
SMB Share Elevated Contributor Full control Read, write, delete, apply permissions to anyone's files and folders
Any of the three roles None Access denied

Full Control in the ACL therefore cannot compensate for a Reader share role, and a Contributor share role cannot override a read-only ACL.

The default share-level permission

Instead of, or as well as, assigning roles to specific users and groups, you can set a default share-level permission on the account. It applies to all file shares in the storage account[27] and gives every authenticated identity the same level. It exists for identities that cannot receive individual Microsoft Entra assignments: AD DS identities that cannot be synced, identities synced to a different Microsoft Entra tenant, and computer accounts, which have no Microsoft Entra identity at all. Windows ACLs then supply the fine-grained control. Its value is None until you change it.

When a user has both a default and an explicit assignment, the user gets the higher-level permission between the default share-level permission and the RBAC assignment[27]: with an explicit SMB Share Reader assignment and a default of SMB Share Elevated Contributor, the user has Elevated Contributor. This does not contradict the most-restrictive rule above. The default and the explicit assignment are two sources for the same share-level layer, and within that layer the higher one wins; the resulting share-level permission then meets the Windows ACL, where the more restrictive one wins. A weaker explicit role therefore cannot narrow a broad default; narrow access with Windows ACLs or by lowering the default.

Takeaway: the share-level permission is the outer layer and the Windows ACL the inner one, the more restrictive of the two decides, and the default share-level permission can only add access.

Kerberos ticket fromthe identity sourceShare-level permission(RBAC role or default)Windows ACL on thefile or directoryEffective access: themore restrictive of the twoExample: SMB Share Readerplus ACL Modify gives Read
How the share-level permission and the Windows ACL combine into effective access on an Azure file share

Administering Windows ACLs on Azure file shares

Setting Windows ACLs needs both admin-level access to the share and a tool that supports the identity type, and this section covers both choices.

Admin-level access: SMB Admin role or the account key

There are two options for mounting a share with admin-level access[26]:

A user who already holds Full Control in the ACL plus the SMB Share Elevated Contributor role can configure ACLs without either option[26]. SMB Share Contributor is not enough to edit ACLs, because its rights stop at read, write and delete (see Share-level permissions and Windows ACLs above).

Tools by identity type

Tool AD DS Microsoft Entra Domain Services Microsoft Entra Kerberos (hybrid) Microsoft Entra Kerberos (cloud-only)
Windows File Explorer Yes Yes Yes No
icacls Yes Yes Yes No
Azure portal No No Yes Yes
PowerShell RestSetAcls module No No Yes Yes

This is the tool matrix in the file-level permission guide[26]. File Explorer and icacls run on a Windows client that has the share mounted with admin-level access and unimpeded network connectivity to the domain controllers[26]. The Azure portal and RestSetAcls have no dependency on domain controllers[26], and they are the only options for cloud-only identities.

One portal behavior trips administrators up: when you edit inheritable permissions on a folder in the Azure portal, they apply only to future direct subfiles and subfolders[26], not to the items that already exist. To push them down to existing items, run Restore-AzFileAclInheritance from the RestSetAcls module with -Recursive.

Azure PowerShell: apply a folder's inheritable ACLs to existing items

This is the guide's example; creating the storage context $context is omitted.

# ...  $context = storage context for the account (creation omitted)
# $FolderPath is the folder whose inheritable entries should reach existing children
Restore-AzFileAclInheritance -Context $context -FileShareName "test" -Path $FolderPath -Recursive

Takeaway: give ACL administrators the SMB Admin role rather than the account key, and use File Explorer or icacls for domain-backed identities but the portal or RestSetAcls for cloud-only ones.

Mount credentials for SMB shares

The credential used to mount an SMB share decides which permission model applies to everything done through that mount, and this section covers the three supported credentials and one that is not supported. Whatever the credential, SMB requires TCP port 445 to be open[28] between the client and the share.

Mount credential How it authenticates Permissions applied
User identity (AD DS, Microsoft Entra Domain Services or Microsoft Entra Kerberos) Kerberos ticket from the account's identity source Share-level permission plus Windows ACLs, per user
Managed identity (Managed Identity for SMB) Microsoft Entra ID, for the workload's own identity The Azure Files roles assigned to that identity
Account name and account key NTLMv2[22] Full permissions to all files and folders on the share, even if they have ACLs[22]

A SAS token is not on the list: shared access signature (SAS) tokens aren't currently supported for mounting Azure file shares[28]. A SAS delegates REST access to files; it cannot be the password for a drive mapping.

Switching a client from the key to an identity

A Windows client that once mounted with the key keeps that connection and its saved credentials. Before mounting with an identity, unmount the share and remove the persistent credentials of the storage account key[28], so that the new connection authenticates as the intended user instead of reusing the key. An identity-based mount then uses the plain form net use Z: \\storage1.file.core.windows.net\share1, with no key on the command line.

Managed identities for SMB

For VMs and applications that need keyless SMB access, Azure Files can authenticate a managed identity. The setup has separate parts, and completing one does not complete the others (managed identity guide[29]):

Managed identity access sits beside the account's single user identity source rather than replacing it, as Choosing an identity source for Azure Files above explains.

Takeaway: mount with a user identity for per-user access, a managed identity for keyless workloads, the account key only for broad administration, and never with a SAS.

Storage data credentials by signing authority

QuestionMicrosoft Entra ID (Azure RBAC role)Account access key (Shared Key)Service SASAccount SASUser delegation SAS
What signs or authorizes itThe caller's Microsoft Entra tokenThe account key itselfAn account keyAn account keyA user delegation key obtained with Microsoft Entra credentials
What it can reachThe data actions of the assigned role, at the assigned scopeAll data in the accountResources in one storage serviceOne or more services, including service-level operationsOnly what both the SAS permissions and the signer's own data permissions allow
Links to a stored access policyNot applicableNot applicableYes (optional)NoNo
Longest validityNot a token you distributeUntil that key is regeneratedIts own expiry, or the linked policy's expiryIts own expirySeven days, bounded by the user delegation key
How to revoke itRemove the role assignmentRegenerate that keyRegenerate the signing key, or edit or delete the linked policyRegenerate the signing keyRevoke the account's user delegation keys
When Shared Key is disallowedStill worksRejectedRejectedRejectedPermitted for Blob Storage, the only case the Shared Key guidance lists

Decision tree

Client can sign in withMicrosoft Entra ID?YesAzure RBACdata roleNoSeveral services, orservice-leveloperations?YesAccount SAS(account key)NoRevoke this groupof tokens centrally?YesService SAS +stored accesspolicyNoUser delegation SAS(at most 7 days)Shared Key disallowed: account andservice SAS rejected; RBAC data rolesand Blob user delegation SAS permitted

Sharp facts the exam loves — give these one last read before exam day.

Cheat sheet

Sharp facts the exam loves — scan these before test day.

Storage network admission and data authorization are separate checks

Azure Storage firewall rules restrict data-plane access through the public endpoint; an allowed client must still present valid authorization. Control-plane operations are outside these restrictions, so viewing an account or listing containers through a management operation does not prove that a client can read blob data. Portal, Storage Explorer, and AzCopy data operations must originate inside the allowed network boundary.

Trap Using an account-level Owner assignment to resolve a data request blocked by the storage firewall, because management authority does not grant network admission.

2 questions test this
A storage virtual network rule needs a service endpoint on the allowed subnet

When a subnet must use a selected-network storage account's public endpoint, enable the storage service endpoint on the subnet and add the subnet to the account's virtual network rules. Microsoft.Storage provides same-region connectivity, while Microsoft.Storage.Global provides connectivity to accounts in any region; a subnet can have only one of these endpoint types at a time. Each account supports 400 virtual network rules, and deleting and recreating an allowed subnet requires explicitly authorizing the new subnet again.

Trap Using virtual network peering alone to admit a subnet to a selected-network storage account, because peering creates neither the storage service endpoint nor the account rule.

2 questions test this
Storage IP rules use the client's public IPv4 egress address

For an on-premises client using the public endpoint, allow the internet-facing public IPv4 address Azure sees, not the client's private address. With ExpressRoute Microsoft peering, allow the peering's NAT public addresses. An account supports 400 IP rules; RFC 1918 addresses and IPv6 are unsupported, and /31 or /32 ranges must be represented as individual IP address rules rather than CIDR ranges.

Trap Adding an on-premises server's 10.x address as a storage IP rule, because the public endpoint evaluates public egress addresses rather than private host addresses.

2 questions test this
Public outbound IP rules cannot identify same-region Azure clients

Azure services in the storage account's region communicate using private Azure addresses, so their public outbound IP ranges do not provide the required storage firewall restriction. Use virtual network rules for eligible same-region subnet clients. Enabling a service endpoint also changes that subnet's storage traffic to use a private source address, making public IP rules for the subnet ineffective.

Trap Allowing a same-region application's documented public outbound range as its storage access boundary, because its storage requests do not originate from those public addresses.

2 questions test this
A private endpoint adds private connectivity without closing the public endpoint

When storage must have a private virtual network address, create and approve a private endpoint; on-premises clients can reach it through VPN or ExpressRoute private peering. Creating the endpoint does not disable public access, so restrict the public endpoint separately for private-only access. The storage firewall controls the public path, whereas the approved private path remains usable with public network access disabled.

Trap Using a service endpoint to obtain a storage service IP inside the subnet, because service endpoints retain the service's public endpoint.

2 questions test this
Storage private endpoints are service-specific and depend on normal-name DNS resolution

A storage private endpoint targets one service subresource, such as blob or file, rather than every service in the account. Data Lake Storage workloads generally need both blob and dfs private endpoints because operations can use both. Clients retain the normal account hostname and connection string, while DNS resolves it to the private address through the matching privatelink.blob.core.windows.net, privatelink.file.core.windows.net, or privatelink.dfs.core.windows.net zone.

Trap Reaching an Azure file share through a blob-targeted private endpoint, because the file service requires its own target subresource and DNS mapping.

2 questions test this
Resource instance rules and trusted-service exceptions admit selected Azure workloads

When an Azure resource cannot be isolated with subnet or IP rules, a resource instance rule can admit that instance; its role assignments still determine permitted data operations. The instance must share the storage account's tenant but can use another subscription. Trusted-service exceptions cover a documented service list, and existing resource-instance and trusted-service exceptions can remain effective after public network access is disabled, so review them when tightening isolation.

Trap Using the trusted Azure services exception as a blanket allowance for every Azure-hosted application, because it covers a defined trusted-service list.

2 questions test this
A SAS delegates bounded data access without distributing the account key

When an external client needs limited access for a defined interval, issue a shared access signature with the smallest resource scope, permissions, and validity period that meet the requirement. The signed query string uses sp for permissions, st and se for validity, and sig for its signature. Possession of an ordinary valid SAS permits its delegated operations, so protect the URL as a credential and add the ? delimiter when a tool returns only the token.

Trap Distributing an account key for a third party's read-only, time-limited download, because the key grants broad account-data access rather than the requested resource and time boundary.

3 questions test this
SAS type determines its signing authority and service scope

A service SAS is account-key signed and targets resources in one storage service; an account SAS is also account-key signed but can cover multiple services and service-level operations such as service properties. Prefer a user delegation SAS where supported when Microsoft Entra-backed delegation is required. Stored access policies apply only to service SAS, so multi-service delegation and policy-linked revocation require different SAS designs.

Trap Using a service SAS for service-property operations across both Blob and Queue Storage, because that delegation requires account-SAS service and resource-type scope.

3 questions test this
Creating a blob user delegation SAS requires a delegation-key action at account scope or higher

Create a blob user delegation SAS with az storage blob generate-sas or az storage container generate-sas using --auth-mode login and --as-user, plus the resource, permissions, and expiry. The signing identity needs Microsoft.Storage/storageAccounts/blobServices/generateUserDelegationKey at storage account, resource group, or subscription scope. A container-scoped data role alone cannot authorize this account-level key request even if the identity can already read the blobs.

Trap Adding only a container-scoped Storage Blob Data Contributor assignment to fix delegation-key generation, because the key-generation action is evaluated above container scope.

2 questions test this
User delegation SAS validity is bounded by its delegation key

A user delegation SAS has a maximum seven-day validity interval and cannot remain usable after its user delegation key expires. Arrange renewal for longer access rather than assigning one token a distant expiry. Use az storage account revoke-delegation-keys to invalidate the account's issued delegation keys and their SAS tokens, allowing for propagation delays caused by cached keys and permissions.

Trap Using a 30-day se value on a user delegation SAS instead of renewal, because a longer token expiry cannot extend the signing key's validity.

2 questions test this
SAS protocol, IP, and time fields narrow how an authorized token can be used

Distribute and use SAS URLs over HTTPS, and constrain allowed protocols with spr and client addresses with sip when appropriate. A signed IP restriction narrows token use but cannot admit requests rejected by the account firewall. For immediate use when no SAS-expiration policy requires a start field, omit the start or set it at least 15 minutes in the past to accommodate clock skew; consider skew at expiry too.

Trap Using a SAS signed-IP restriction to admit a client excluded by the account firewall, because token restrictions cannot broaden the network allowance.

3 questions test this
SAS expiration policy can audit or enforce the maximum signed validity interval

A SAS expiration policy compares signed expiry minus signed start with an account-level upper limit; a missing start also makes a SAS out of policy. Default Log allows requests and can record SasExpiryStatus through diagnostic logging, while Block rejects out-of-policy requests. The policy covers user delegation, service, and account SAS, but its action is unsupported for user delegation SAS through the HDFS endpoint or service SAS linked to stored access policies.

Trap Using the default Log action to enforce a mandatory token-lifetime ceiling, because logging records noncompliance while allowing the request.

3 questions test this
An account SAS must permit the service, resource type, and operation together

An account SAS uses ss to select services: b for Blob, f for Files, q for Queue, and t for Table. Its srt field selects service-level operations with s, container-level operations with c, and object-level operations with o; sp must also permit the requested operation at that resource type. With the account key supplied securely through AZURE_STORAGE_KEY and $expiry set to the intended UTC expiry, az storage account generate-sas --account-name storage1 --services b --resource-types co --permissions rl --expiry "$expiry" --https-only -o tsv creates a Blob-only token for reading blobs and listing blobs within containers. Listing the account's containers instead requires service resource type s and list permission l.

Trap Using az storage container generate-sas to delegate changes to Blob service properties, which require account-SAS service-level scope.

2 questions test this
Storage Blob Delegator separates delegation-key generation from blob-data access

When a signer must issue user delegation SAS tokens for just one container, combine Storage Blob Delegator at storage-account scope or higher with the required blob-data role scoped to that container. Delegator permits requesting a user delegation key but contains no blob DataActions; the container assignment supplies the actual data rights. For example, container-scoped Storage Blob Data Reader plus account-scoped Delegator supports read delegation without granting read access to sibling containers, and the SAS permissions must stay within the signer's data rights.

Trap Assigning Storage Blob Data Reader at account scope to resolve a delegation-key error, which also grants read access across the account's containers.

2 questions test this
Azure Storage does not track an inventory of generated SAS tokens

SAS tokens can be generated on the client, and Azure Storage neither tracks those tokens nor provides an API to enumerate or count every issued token. Token generation itself cannot be comprehensively audited by the storage service, even though requests that use tokens can be logged. Establish expiry, any issuer-side issuance records, and a supported revocation plan before distributing credentials rather than relying on finding and deleting one token from a service-maintained registry.

When service SAS tokens need centrally managed constraints, define a stored policy on their blob container, file share, queue, or table and reference its signed identifier. A container policy can govern access to the container or its blobs, and a share policy can govern the share or its files. User delegation and account SAS tokens are ad hoc and cannot link to these policies.

Trap Creating a storage-account-wide stored policy for an account SAS, because stored policies attach to resource containers and apply to service SAS.

2 questions test this
A SAS and its stored policy must not both specify the same access parameter

A policy-linked service SAS can obtain start time, expiry, and permissions from the URI, from its policy, or divided between them. Each individual parameter can appear in only one place, so a permission or expiry carried by the policy cannot also appear on the SAS. Put parameters requiring later central changes in the policy instead of fixing them in every distributed token.

Trap Repeating expiry in both the token and stored policy for redundancy, because the same parameter cannot be defined in both locations.

2 questions test this
Changing a stored policy changes access for every SAS linked to its identifier

Reduce permissions for linked service SAS tokens by replacing policy permissions while retaining the identifier. Revoke the group by deleting the policy, changing its identifier, or moving its expiry into the past. These changes affect linked signatures rather than unrelated ad hoc tokens, so independently revocable client groups need separate policies.

Trap Rotating an account key to revoke only one policy-linked client group, because rotation also invalidates unrelated signatures signed with that key.

2 questions test this
Stored policies have a five-policy limit and a short activation delay

A container, share, queue, or table holds at most five stored policies at once, although one policy can serve many SAS tokens. A sixth policy returns 400 Bad Request, so plan independent revocation groups within that per-resource limit. Creating or updating a policy can take up to 30 seconds to activate, during which linked SAS requests can return 403 Forbidden.

2 questions test this
Access to storage account keys is effectively broad access to account data

Azure creates two 512-bit account keys, either of which can authorize Shared Key data access and sign service or account SAS tokens. Reading keys requires Microsoft.Storage/storageAccounts/listkeys/action and regeneration requires Microsoft.Storage/storageAccounts/regeneratekey/action; Storage Account Key Operator Service Role provides these capabilities without general resource administration. Store required keys in Key Vault and prefer supported Microsoft Entra authorization over distributing broad secrets.

Trap Using Storage Blob Data Reader to delegate account-key rotation, because blob data access does not grant account-key management actions.

3 questions test this
The second storage key enables rotation while clients keep using a valid key

First switch dependent clients to the other valid key, regenerate the original, and switch clients to the regenerated value before rotating the second key. Regenerate with New-AzStorageAccountKey -KeyName key1 or key2, or az storage account keys renew --key primary or secondary, rather than a key-listing command. Keep normal client use on one key at a time so the alternate remains available for rotation.

Trap Regenerating the key referenced by applications before changing their connection strings, because those clients still depend on the old key value.

3 questions test this
Key regeneration and disabling Shared Key invalidate different sets of credentials

Regenerating one key invalidates clients and service or account SAS signed with that key, leaving the other key and user delegation SAS unaffected. Setting AllowSharedKeyAccess to false instead rejects account-key-authorized requests and key-signed service and account SAS; blob user delegation SAS remains permitted through Microsoft Entra-backed authorization. Null or true permits Shared Key, and disabling it does not itself disable configured anonymous blob reads.

Trap Replacing a disallowed Shared Key connection with an account SAS, because account SAS still uses account-key authorization.

3 questions test this
A key expiration policy schedules rotation reminders rather than rotating keys

A key expiration policy records the desired rotation interval and displays reminders; administrators still rotate the keys, and Azure Policy can audit compliance. If KeyCreationTime is null for a key, regenerate it before configuring the policy. Set the interval with Set-AzStorageAccount -KeyExpirationPeriodInDay or az storage account update --key-exp-days rather than assuming the reminder updates client secrets.

Trap Using key-expiration reminders as an automatic key-replacement schedule, because reminder and compliance checks do not regenerate keys.

3 questions test this
Azure Files user identity authentication uses one Kerberos identity source per account

Azure Files supports SMB user authentication through AD DS, Microsoft Entra Domain Services, or Microsoft Entra Kerberos. Enable one user identity source per account, applying to all its shares, with Kerberos enabled in SMB authentication settings. NFS shares do not use these SMB identity methods, and changing the identity source temporarily interrupts identity-based access to the account's shares.

Trap Configuring AD DS for one share and Entra Domain Services for another in the same account, because the user identity-source setting is account-wide.

3 questions test this
AD DS and Microsoft Entra Domain Services authenticate file clients through reachable domain controllers

Use AD DS authentication to retain an existing domain when clients can reach its domain controllers, hosted on-premises or on Azure VMs. Use Microsoft Entra Domain Services when a managed domain in Azure fits the requirement, with clients configured for that domain and its connectivity. For hybrid per-identity share authorization, assign roles to the corresponding synced Microsoft Entra identities or groups; successful domain authentication alone does not grant share permission.

Trap Selecting AD DS authentication for clients unable to reach any domain controller, because that source requires domain-controller connectivity for authentication.

3 questions test this
Microsoft Entra Kerberos file access requires supported clients and identity preparation

For the standard Microsoft Entra Kerberos authentication flow on supported Windows clients, clients must be Microsoft Entra joined or Microsoft Entra hybrid joined. For hybrid users, create the identities in AD DS and synchronize them to Microsoft Entra ID through Microsoft Entra Connect Sync or cloud sync; cloud-only identities do not require that synchronization. Exclude the Microsoft Entra application representing the storage account from applicable MFA Conditional Access policies because this file-share authentication flow does not support MFA.

Trap Leaving the storage account application in an all-apps MFA requirement for Microsoft Entra Kerberos file access, because the SMB authentication flow cannot satisfy that requirement.

4 questions test this
Ordinary identity-based file access must pass both share and Windows ACL checks

Share-level permission is the first gate, followed by Windows ACL restrictions on directories and files. For ordinary SMB share roles, the most restrictive combination applies: share Reader with file Modify permits only reading, as does share Contributor with a read-only file ACL. Scope a role to the individual share when it must not authorize sibling shares.

Trap Using file Full Control to compensate for share Reader, because the share-level gate still limits the operation.

4 questions test this
SMB roles distinguish reading, modifying file data, and administering ACLs

Storage File Data SMB Share Reader grants read access, Share Contributor adds write and delete, and Share Elevated Contributor adds ACL modification subject to Windows permissions. Storage File Data SMB Admin enables an identity-based administrator to take ownership and adjust ACLs when existing ACLs provide insufficient rights. SMB Admin does not make normal file access ignore ACLs, unlike mounting with the account key.

Trap Using Storage File Data SMB Share Contributor for a user who must edit file ACLs, because its data-modification rights do not include ACL administration.

3 questions test this
Default share permission applies broadly and cannot be narrowed by a weaker explicit role

An account default share permission grants its level to all authenticated identities across the account's shares, supporting identities that cannot receive individual Microsoft Entra assignments. Windows ACLs remain available for granular restriction. When default and explicit user or group share permissions both apply, the higher level wins, so a specific Reader assignment cannot reduce an Elevated Contributor default.

Trap Assigning specific Reader access to narrow a user's account-default Contributor permission, because the higher share-level permission takes precedence.

3 questions test this
Azure Files ACL administration tools differ for hybrid and cloud-only identities

File Explorer and icacls manage ACLs for hybrid AD-backed authentication when the administrative Windows client has required domain connectivity. For Entra Kerberos cloud-only identities, use the Azure portal or RestSetAcls; these also support hybrid Entra Kerberos ACL management without a domain-controller dependency. Portal inheritable ACL edits affect future children, so use Restore-AzFileAclInheritance -Recursive when existing descendants must receive them.

Trap Using icacls to assign permissions to Entra Kerberos cloud-only identities, because that scenario requires supported portal or REST-based ACL tooling.

3 questions test this
An SMB mount uses an identity or account key rather than a SAS token

Mount SMB shares with a configured domain or Microsoft Entra identity for user-specific access, or with account name and key for broad administration. A key-based mount uses NTLMv2 and bypasses normal file ACL restrictions; SAS tokens are not SMB mount credentials. Before replacing a key mount with identity-based access, remove the old SMB connection and cached key credentials so the new connection uses the intended identity.

Trap Using a share SAS as the password for an SMB drive mapping, because SAS is not an SMB authentication method.

3 questions test this
Managed-identity SMB access needs SMBOAuth and separate client and permission setup

For supported Windows or Linux VM workloads needing keyless SMB access, enable Managed Identity for SMB, the SMBOAuth account property, and ensure that Kerberos remains allowed in the separate SMB authentication-method setting. Assign the workload identity the required file-data permissions, such as Storage File Data SMB MI Admin for administrative access, and prepare the client with AzFilesSmbMIClient on Windows or azfilesauth on supported Linux distributions. Follow the documented non-domain-joined client requirements; enabling SMBOAuth alone does not prepare a mount. Managed-identity access is separate from the account's one user identity source and can coexist with that user authentication configuration.

Trap Using a SAS URL as the SMB mount credential for the workload, which delegates REST access rather than authenticating the SMB client.

3 questions test this
Linux SMB user authentication needs AD DS or Microsoft Entra Domain Services

When Linux users need identity-based SMB access to Azure Files, use the documented AD DS or Microsoft Entra Domain Services client configuration with the required domain connectivity. Both sources support Windows and Linux user clients, whereas Microsoft Entra Kerberos user authentication does not support Linux. Linux workload access through a managed identity is a separate supported path, not evidence that Entra Kerberos user authentication works on Linux.

Trap Replacing SMB with an Azure Files NFS share to retain per-user Kerberos authentication on Linux, which uses the NFS host-based model instead of SMB identity authentication.

Microsoft Entra Kerberos authenticates Azure Files users without client connectivity to domain controllers

When supported Windows clients need identity-based Azure Files access without network connectivity to domain controllers, use Microsoft Entra Kerberos. Microsoft Entra ID issues the Kerberos tickets that clients present to Azure Files, removing the domain-controller connectivity requirement from authentication. Clients still need network access to the file-share endpoint; cloud ticket issuance does not provide an SMB network path.

Trap Using Microsoft Entra Domain Services solely to avoid domain-controller connectivity, even though its managed domain controllers must remain reachable by authenticating clients.

3 questions test this
Azure Files AD DS authentication requires registering the storage account in the domain

Azure Files AD DS authentication requires a computer account or service logon account in AD DS that represents the storage account, together with the corresponding domain properties configured on the Azure storage account. Use Join-AzStorageAccount from the AzFilesHybrid PowerShell module to perform the equivalent of an offline domain join and enable the feature, or complete the documented registration and account-configuration steps manually. Verify the result through the storage account's AzureFilesIdentityBasedAuth.DirectoryServiceOptions and ActiveDirectoryProperties before proceeding with share permissions.

Trap Assigning Storage File Data SMB Share Contributor to domain users as the enablement step, because a share authorization grant does not register the storage account with AD DS.

3 questions test this

Also tested in

References

  1. https://learn.microsoft.com/en-us/credentials/certifications/resources/study-guides/az-104
  2. https://learn.microsoft.com/en-us/azure/storage/common/shared-key-authorization-prevent
  3. https://learn.microsoft.com/en-us/azure/storage/common/storage-network-security
  4. https://learn.microsoft.com/en-us/azure/storage/common/storage-network-security-limitations
  5. https://learn.microsoft.com/en-us/azure/storage/common/storage-network-security-virtual-networks
  6. https://learn.microsoft.com/en-us/azure/storage/common/storage-network-security-set-default-access
  7. https://learn.microsoft.com/en-us/azure/virtual-network/virtual-network-service-endpoints-overview
  8. https://learn.microsoft.com/en-us/azure/storage/common/storage-private-endpoints
  9. https://learn.microsoft.com/en-us/azure/storage/common/storage-sas-overview
  10. https://learn.microsoft.com/en-us/azure/storage/common/storage-account-keys-manage
  11. https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles/storage
  12. https://learn.microsoft.com/en-us/rest/api/storageservices/create-account-sas
  13. https://learn.microsoft.com/en-us/azure/storage/blobs/storage-blob-user-delegation-sas-create-cli
  14. https://learn.microsoft.com/en-us/azure/storage/common/sas-expiration-policy
  15. https://learn.microsoft.com/en-us/cli/azure/storage/account
  16. https://learn.microsoft.com/en-us/rest/api/storageservices/create-user-delegation-sas
  17. https://learn.microsoft.com/en-us/azure/storage/blobs/data-lake-storage-introduction
  18. https://learn.microsoft.com/en-us/rest/api/storageservices/define-stored-access-policy
  19. https://learn.microsoft.com/en-us/cli/azure/storage/container/policy
  20. https://learn.microsoft.com/en-us/cli/azure/storage/container
  21. https://learn.microsoft.com/en-us/azure/storage/files/storage-files-active-directory-overview
  22. https://learn.microsoft.com/en-us/azure/storage/files/storage-files-planning
  23. https://learn.microsoft.com/en-us/azure/storage/files/storage-files-identity-ad-ds-enable
  24. https://learn.microsoft.com/en-us/azure/storage/files/storage-files-identity-auth-hybrid-identities-enable
  25. https://learn.microsoft.com/en-us/azure/storage/files/storage-files-identity-auth-hybrid-cloud-trust
  26. https://learn.microsoft.com/en-us/azure/storage/files/storage-files-identity-configure-file-level-permissions
  27. https://learn.microsoft.com/en-us/azure/storage/files/storage-files-identity-assign-share-level-permissions
  28. https://learn.microsoft.com/en-us/azure/storage/files/storage-how-to-use-files-windows
  29. https://learn.microsoft.com/en-us/azure/storage/files/files-managed-identities