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.
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.
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
- User delegation SAS is Microsoft's recommendation for scenarios where shared access signatures are used[9], because it is secured with Microsoft Entra credentials instead of the account key, so no key has to be stored with your code. The SAS overview lists support for Blob Storage (including Data Lake Storage), Queue Storage, Table Storage and Azure Files; the commands later in this topic create blob and container user delegation SAS tokens.
- Service SAS suits key-signed delegation to resources in a single service, and it is the only type that can link to a stored access policy for central changes and group revocation.
- Account SAS is needed when one token must span several services, or must reach operations that no service SAS can delegate: service-level operations such as Get/Set Service Properties and Get Service Stats, and write and delete operations on containers, queues, tables and file shares[12].
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:
- Assign Storage Blob Data Reader at the account instead. This works, but it also grants read access to every other container in the account.
- Keep the container-scoped data role and add the Storage Blob Delegator role at the storage account, resource group or subscription[16]. Storage Blob Delegator[11] contains only the key-generation action and no data actions, so the signer gains the ability to request a key without gaining data access anywhere.
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.
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
- The expiration action is not supported for user delegation SAS through the HDFS endpoint, or for service SAS tokens with a stored access policy[14]. HDFS is the Hadoop Distributed File System, and Hadoop distributions include the Azure Blob File System (ABFS) driver[17]: frameworks that use HDFS as their data access layer can directly access Azure Data Lake Storage data through ABFS[17], whose REST APIs use the endpoint
dfs.core.windows.net[17]. - A user delegation SAS has a maximum expiry interval of 7 days regardless of the policy[14], so a limit above 7 days has no effect on it.
- If either account key has a null
KeyCreationTime, you must rotate the keys before you can configure the policy[14].
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
- Narrow access: replace the policy with new permissions under the same signed identifier; for example, a policy that grants read and write can be changed to grant only read for all future requests[18].
- Revoke the group: delete the policy, rename it by changing the signed identifier, or change the expiry time to a value in the past[18].
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.
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.
- Switch every client's connection string to key2, the key you are not rotating yet.
- Regenerate key1. Its old value stops working, together with any service or account SAS signed with it.
- Switch the clients to the new key1.
- 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.
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:
- Linux users. AD DS and Microsoft Entra Domain Services both authenticate Linux user clients; Microsoft Entra Kerberos does not. A Linux workload that runs as a managed identity is a separate path (see Mount credentials for SMB shares below), not evidence that Microsoft Entra Kerberos supports Linux users. Switching to an NFS share does not help either, because NFS uses host-based authentication, not per-user Kerberos.
- No route to a domain controller. With AD DS, clients must have unimpeded network connectivity to the domain controller[21], and Microsoft Entra Domain Services clients likewise need network connectivity to the managed domain[21], so choosing Microsoft Entra Domain Services does not remove the need to reach domain controllers. Microsoft Entra Kerberos does remove it, because Microsoft Entra ID issues the Kerberos tickets, so end users can access Azure file shares without requiring network connectivity to domain controllers[21]. Clients still need a network path to the file share endpoint itself; cloud ticket issuance does not provide one.
- An existing domain to keep. If an AD DS domain already exists and clients reach it, AD DS lets users keep the credentials they already use. Otherwise choose between a managed domain (Microsoft Entra Domain Services) and Microsoft Entra Kerberos by the best-fit column above.
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.
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]:
- Client join state. For the standard flow, clients must be Microsoft Entra joined or Microsoft Entra hybrid joined[24]; they can't be joined only to AD or to Microsoft Entra Domain Services. Clients that do not meet these prerequisites can still use Microsoft Entra Kerberos, but you need to configure a cloud trust[24]: an incoming trust relationship in which on-premises Active Directory Domain Services trusts Microsoft Entra ID as a Kerberos Key Distribution Center (KDC)[25].
- Identity preparation. For hybrid users, create the accounts in Active Directory and sync them to Microsoft Entra ID with Microsoft Entra Connect Sync or Microsoft Entra Cloud Sync[24]; groups used for share permissions follow the same rule. Cloud-only identities need no sync.
- MFA exclusion. Microsoft Entra Kerberos doesn't support using MFA to access Azure file shares[24], so exclude the Microsoft Entra application that represents the storage account from MFA Conditional Access policies that apply to all apps; otherwise mapping the share fails with System error 1327.
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.
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]:
- Storage File Data SMB Admin (recommended). Assign this role to the administrators who manage ACLs, and have them mount the share with their own identity. The role grants share access plus the right to take ownership of any file or directory with the Windows
takeowncommand. With this role, the existing ACLs still apply for normal file access[26];takeownis needed only when an ACL does not already give the administrator enough rights to change permissions. No account key is involved. - Storage account key (less secure). Mounting with the key gives immediate full access to all files and directories without needing to take ownership[26]. That is exactly why it bypasses the ACLs, and why Microsoft reserves it for cases where identity-based authentication cannot be used.
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]):
- Account property. Enable Managed Identity for SMB, the
SMBOAuthproperty, for example withSet-AzStorageAccount -ResourceGroupName rg1 -Name storage1 -EnableSmbOAuth $true. - Kerberos still allowed. The storage account's SMB security settings must allow Kerberos authentication, and enabling SMBOAuth doesn't enable or validate this separate setting[29]. This does not contradict the Microsoft Entra ID row in the table above: on Windows, the
AzFilesSmbMIClient.exe refreshcommand, from theAzFilesSmbMIClientmodule installed under Client preparation below, gets an OAuth token and inserts it in the Kerberos cache[29]. - Permissions. Assign the workload identity a file data role, for example Storage File Data SMB MI Admin[29] for admin-level access.
- Client preparation. On Windows (Windows Server 2019 or later, or any Windows client version), install the
AzFilesSmbMIClientmodule; on Linux (Azure Linux 3.0, Ubuntu 22.04 or 24.04, RHEL 9.6 or later, SLES 15 SP6 or later), installazfilesauth. Clients that authenticate with a managed identity shouldn't be joined to any domain[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
| Question | Microsoft Entra ID (Azure RBAC role) | Account access key (Shared Key) | Service SAS | Account SAS | User delegation SAS |
|---|---|---|---|---|---|
| What signs or authorizes it | The caller's Microsoft Entra token | The account key itself | An account key | An account key | A user delegation key obtained with Microsoft Entra credentials |
| What it can reach | The data actions of the assigned role, at the assigned scope | All data in the account | Resources in one storage service | One or more services, including service-level operations | Only what both the SAS permissions and the signer's own data permissions allow |
| Links to a stored access policy | Not applicable | Not applicable | Yes (optional) | No | No |
| Longest validity | Not a token you distribute | Until that key is regenerated | Its own expiry, or the linked policy's expiry | Its own expiry | Seven days, bounded by the user delegation key |
| How to revoke it | Remove the role assignment | Regenerate that key | Regenerate the signing key, or edit or delete the linked policy | Regenerate the signing key | Revoke the account's user delegation keys |
| When Shared Key is disallowed | Still works | Rejected | Rejected | Rejected | Permitted for Blob Storage, the only case the Shared Key guidance lists |
Decision tree
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
- Storage1 allows public network access only from selected virtual networks and IP addresses. User1 has the Storage Blob Data Reader role on storage1 and uses Azure Storage Explorer from an office whose
- Storage1 allows public network access only from Subnet1 in VNet1. Admin1 has the Owner role on the subscription and must download the blobs in a container named audit by using AzCopy. Admin1's worksta
- 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
- Storage1 allows access only from a virtual network rule for Subnet1 in VNet1, and Subnet1 has the Microsoft.Storage service endpoint enabled. During a redeployment, an engineer deletes Subnet1 and cre
- VMs in Subnet1 of VNet1 in the East US region must access storage1, which is in the West Europe region and allows public network access only from selected virtual networks. You plan to add a virtual n
- 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
- Your on-premises network connects to Azure by using ExpressRoute with Microsoft peering, and the service provider performs NAT for that peering. On-premises servers must reach storage1 through its pub
- An on-premises server named Server1 has the private IP address 10.1.1.20 and reaches the internet through a NAT device whose public IP address is 203.0.113.5. Storage1 allows public network access onl
- 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
- VM1 in Subnet1 has a public IP address and accesses storage2 in another region through an IP network rule for that address. You enable the Microsoft.Storage.Global service endpoint on Subnet1 for anot
- Storage1 and an Azure App Service app named App1 are both in the East US region. You add App1's documented outbound public IP addresses as IP network rules on storage1, which allows only selected netw
- 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
- Your on-premises datacenter connects to a virtual network named VNet1 by using ExpressRoute private peering only. On-premises clients must access blob data in storage1 by using a private IP address fr
- You create and approve a private endpoint for the blob service of storage1 in VNet1. Storage1 still has public network access enabled from all networks. A security review finds that clients on the int
- 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
- You create a private endpoint for the blob service of storage1 in VNet1, with the default private DNS zone linked to VNet1. App1 on a VM in VNet1 uses a connection string that contains storage1.blob.c
- VMs in VNet1 use a custom DNS server named DNS1 that forwards all queries to an internet DNS service. You create a private endpoint for the blob service of storage1 in VNet1 and set public network acc
- 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
- Storage1 was set to Enabled from selected virtual networks and IP addresses with a resource instance rule and the trusted Azure services exception. You then set Public network access to Disabled. A tr
- An Azure Synapse Analytics workspace in Subscription2 must write to storage1 in Subscription1. Both subscriptions are in the same Microsoft Entra tenant, and the workspace can't be isolated through vi
- 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
- You run az storage blob generate-sas for a blob and receive a token that begins with se=2026-11-03&sp=r&sv=. You concatenate https://storage1.blob.core.windows.net/data/file1.csv directly with the tok
- You have an Azure subscription that contains a storage account named storage1. An external auditor must download a single blob named report.pdf from a container named reports in storage1 during the ne
- A developer has a service SAS URL for a blob that contains sp=rw, st, se, and sig fields. To reduce risk, the developer edits the URL in place, changing sp=rw to sp=r, and leaves every other field unc
- 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
- An application must call the Set Service Properties operation on both the Blob service and the Queue service of a storage account named storage1 by using a single shared access signature. The applicat
- You must give 50 contractors read access to a blob container named media by using SAS tokens signed with the account key. You must be able to revoke all of the contractors' tokens at once without rege
- Your security policy prohibits any shared access signature that is signed with a storage account key. A web app that has a managed identity must hand out short-lived read tokens for blobs in a contain
- 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
- A support engineer signed in to the Azure CLI with a Microsoft Entra account must send a vendor a user delegation SAS URL for one blob named trace.zip in a container named logs in storage1. The vendor
- User1 has the Storage Blob Data Contributor role scoped to a container named data in a storage account named storage1 and can upload blobs. When User1 runs az storage container generate-sas with --aut
- 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
- A user delegation SAS for a container in a storage account named storage1 was posted in a public forum. You must invalidate it as quickly as possible by using the Azure CLI. Other applications use acc
- You run az storage account revoke-delegation-keys for a storage account named storage1 after a user delegation SAS is compromised. For a short time afterward, the storage logs still show successful re
- 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
- An application creates a SAS with the start time set to the current time and immediately passes it to a client. For the first few minutes, some requests from the client fail authorization, and later r
- You use az storage account generate-sas to create an account SAS for a storage account named storage1. The SAS must be usable only over HTTPS, and the account key is supplied through the AZURE_STORAGE
- Storage1 allows public network access only from selected virtual networks, and no IP network rules exist. You create a SAS for a container with sip set to 203.0.113.10, the public IP address of a part
- 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
- You configure a SAS expiration policy with an upper limit of one day on a storage account named storage1 and keep the default expiration action. Users still create 30-day SAS tokens, and requests made
- Storage1 has a SAS expiration policy with an upper limit of seven days and the Block action. A script creates a two-day service SAS that has an expiry value but no signed start field and is not linked
- You set a SAS expiration policy on a storage account named storage1 with the Block action. Clients use four kinds of tokens against storage1: account SAS, ad hoc service SAS, user delegation SAS throu
- 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
- A client uses an account SAS for storage1 that has the fields ss=b, srt=co, sp=rl, spr=https, and an se value later this month. The client can list the blobs in each container, but its request to list
- You need an account SAS for a storage account named storage1 that lets a client read blobs and list the blobs within containers. The token must not grant access to Azure Files, Queue Storage, or Table
- 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
- Identity1 has only the Storage Blob Delegator role at the scope of a storage account named storage1. Identity1 successfully creates a user delegation SAS with read permission for a blob in a container
- An app's managed identity must create read-only user delegation SAS tokens for blobs in a container named invoices in a storage account named storage1. The identity must not be able to read blobs in a
- 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.
- A stored access policy groups service SAS tokens at a resource container
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
- You plan to link tokens to a stored access policy named policy1 on a file share named share1 in storage1. You currently issue three kinds of tokens for share1: an account SAS for Azure Files, a servic
- You have a storage account named storage1 that contains a blob container named container1. You issue service SAS tokens that grant read access to individual blobs in container1. You need to manage the
- 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
- You issue service SAS tokens for a queue named orders. Each token has its own fixed permissions, but you must be able to shorten the expiry of all tokens later without redistributing them. The tokens
- A stored access policy named policy1 on container1 defines an expiry time and read permission. A script issues service SAS tokens that reference policy1 and also include an se value with the same expi
- 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
- Twenty partner apps use service SAS tokens linked to a stored access policy named partners on container1. The policy currently grants read and write. You must reduce all partner tokens to read-only wi
- Contractors use service SAS tokens linked to a stored access policy named contractors on container1. Other applications use ad hoc service SAS tokens signed with key1 for the same account. You must re
- 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
- You create a stored access policy named policy2 on a queue and immediately issue a service SAS that references policy2. For about the first half minute, requests made with the SAS return 403 (Forbidde
- A blob container named container1 already has five stored access policies, each used by a different group of service SAS tokens. An administrator calls Set Container ACL to add a sixth policy for a ne
- 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
- You are creating a custom Azure role named KeyViewer for a support team. Members must be able to view the access keys of the storage accounts in a resource group named RG1 to troubleshoot application
- You have an Azure subscription that contains a storage account named storage1. A runbook uses a managed identity named Identity1 to list and regenerate the access keys of storage1 every 60 days. Ident
- You have an Azure subscription that contains a storage account named storage1 and a virtual machine named VM1. App1 on VM1 is a legacy application that can authorize to storage1 only by using an accou
- 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
- You have a storage account named storage1. Three applications connect to storage1 by using connection strings that reference key1. No application uses key2. You plan to regenerate key1 without interru
- You have a storage account named storage1. App1 uses key1 and App2 uses key2 in their connection strings. You plan a monthly key rotation process. You need to ensure that each key can be regenerated i
- You rotate the access keys of storage1 by using the Azure CLI. You moved all applications to key2, ran az storage account keys renew for the primary key, and then updated every application to use the
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
- You have a storage account named storage1 that was created three years ago. You run az storage account show --query allowSharedKeyAccess for storage1, and the command returns null. An application stil
- You have a storage account named storage1. A container named public1 is configured for anonymous read access. You set AllowSharedKeyAccess for storage1 to false. Users report that blobs in public1 can
- You have a storage account named storage1 that hosts blob containers. You set AllowSharedKeyAccess for storage1 to false. Four clients access blob data: Client1 uses a connection string with key1, Cli
- 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
- You configure a key expiration policy of 60 days on a storage account named storage1. Seventy days later, no one has regenerated key1 or key2, and applications still connect by using key1. You need to
- Storage1 has been in use since before key creation times were recorded, and nobody has ever regenerated its access keys. An administrator tries to add a 90-day key expiration policy to storage1 by usi
- You have a storage account named storage1 in a resource group named RG1. KeyCreationTime is populated for both keys, and applications use key1. You need a reminder to appear if the access keys aren't
- 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
- You have an Azure subscription that contains a storage account named storage1. Storage1 hosts two SMB file shares named share1 and share2. Users in the on-premises AD DS domain must authenticate to sh
- You have a premium FileStorage account named storage1 that contains two SMB file shares named share1 and share2 and an NFS file share named share3. You plan to enable Microsoft Entra Kerberos authenti
- You have a storage account named storage1 that uses a custom SMB security profile. The profile allows only NTLMv2 under Authentication methods. You enable Microsoft Entra Domain Services authenticatio
- 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
- Your company has no on-premises Active Directory. All users are cloud-only Microsoft Entra ID users. Windows and Linux VMs in an Azure virtual network must access an SMB Azure file share by using the
- You have a storage account named storage1 that uses Microsoft Entra Domain Services authentication for its SMB file shares. A Windows Server computer named Server1 runs in your on-premises datacenter,
- You have a storage account named storage1 that uses AD DS authentication for an SMB file share named share1. User1 is an AD DS user who is synced to Microsoft Entra ID as user1@contoso.com. User1 sign
- 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
- You enable Microsoft Entra Kerberos authentication for hybrid identities on a storage account named storage1. User accounts are created in on-premises AD DS and synchronized by using Microsoft Entra C
- Your organization has no on-premises AD DS, and all users are cloud-only Microsoft Entra ID users on Microsoft Entra joined Windows 11 devices that meet the OS requirements. You need users to access S
- You enable Microsoft Entra Kerberos authentication on a storage account named storage1 for hybrid users. A Conditional Access policy requires multifactor authentication for all users and all cloud app
- You plan to use the standard Microsoft Entra Kerberos authentication flow for hybrid identities on a storage account. You have four supported Windows 11 clients: VM1 is Microsoft Entra joined, VM2 is
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
- User2 has the Storage File Data SMB Share Contributor role on an SMB Azure file share named share1. The Windows ACL on a directory named Reports in share1 grants User2 only Read & Execute. User2 must
- You have an SMB Azure file share named share1 that uses identity-based authentication. User1 has the Storage File Data SMB Share Reader role on share1. A Windows ACL grants User1 Full Control on a dir
- You have a storage account named storage1 that contains file shares named Finance and HR. Identity-based authentication is enabled. A group named FinanceUsers must have read, write, and delete share-l
- User3 has the Storage File Data SMB Share Elevated Contributor role on an SMB Azure file share named share1. The Windows ACL on a directory named Data in share1 grants User3 only the NTFS Write permis
- 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
- User1 must change the Windows ACLs on files in an SMB Azure file share named share1 by using File Explorer. User1 already has Full Control in the existing ACLs on those files and mounts share1 by usin
- Admin1 must repair the Windows ACL on a directory in an SMB Azure file share named share1. The existing ACL denies Admin1 access to the directory. Admin1 must mount share1 by using identity-based auth
- Admin2 has the Storage File Data SMB Admin role on an SMB Azure file share named share1 and mounts share1 by using identity-based authentication. The ACL on a file named Payroll.xlsx doesn't grant Adm
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
- You have a storage account named storage1 that uses AD DS authentication. Several on-premises servers must access SMB file shares on storage1 by using their AD DS computer accounts and a group Managed
- You have a storage account named storage1 that uses identity-based authentication. The default share-level permission for storage1 is Storage File Data SMB Share Elevated Contributor. You assign User1
- The default share-level permission on a storage account named storage1 is Storage File Data SMB Share Contributor. User2 must be prevented from writing files in a directory named Audit on a share in s
- 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
- Storage1 uses Microsoft Entra Kerberos authentication for cloud-only identities, and there is no on-premises Active Directory. You must grant a cloud-only user named User1 Modify permission on a direc
- Storage1 uses on-premises AD DS authentication, and users are hybrid identities. An administrator plans to use icacls from a Windows computer to configure directory permissions on a file share in stor
- You use the Azure portal to add an inheritable Read permission for a cloud-only user on a folder named Projects in an Azure file share that uses Microsoft Entra Kerberos. New subfolders receive the pe
- 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
- You have a storage account named storage1 that uses on-premises AD DS authentication for an SMB file share named share1. A contractor has an AD DS user account that is synced to Microsoft Entra ID. Th
- A partner must download files from a share named share1 in storage1 during the next seven days. The partner's network blocks outbound TCP port 445, the partner has no identity in your Microsoft Entra
- You harden the SMB security settings of storage1 by allowing only Kerberos under Authentication methods. Users who map shares with their AD DS identities are unaffected, but a legacy service that maps
- 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
- SMBOAuth is enabled on storage1, Kerberos is allowed, and VM2, a Windows VM that isn't joined to a domain, has a managed identity with Storage File Data SMB MI Admin. You must prepare VM2 so that it c
- A Linux VM workload must mount an SMB Azure file share in storage1 by using the VM's managed identity instead of the storage account key. Kerberos is already allowed in the SMB security settings of st
- You enable SMBOAuth on storage1 and assign Storage File Data SMB MI Admin to the system-assigned managed identity of VM1. VM1 is a Windows Server VM that is joined to your on-premises AD DS domain. Mo
- 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
- Your company plans to switch storage1 to Microsoft Entra Domain Services so that home-office Windows clients, which have no VPN, no Azure connectivity to the managed domain, and aren't joined to any m
- Your organization has no on-premises AD DS. Cloud-only users on Microsoft Entra joined Windows 11 laptops work from home and must map an SMB share in storage1, which uses Microsoft Entra Kerberos auth
- Storage1 uses Microsoft Entra Kerberos for cloud-only users, and no domain controllers exist. Storage1 allows public network access only from selected networks, with an IP rule for the head office. Us
- 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
- After running the AD DS registration steps for storage1, you must verify by using Get-AzStorageAccount in Azure PowerShell that AD DS is the configured identity source and that the domain properties a
- Your security policy prevents you from using the AzFilesHybrid module, so you must manually register a storage account named storage1 with your on-premises AD DS for Azure Files authentication. You ha
- You must enable on-premises AD DS authentication for Azure Files on storage1. You have domain admin credentials, a domain-joined Windows computer running PowerShell 5.1, and the AzFilesHybrid module d
Also tested in
References
- https://learn.microsoft.com/en-us/credentials/certifications/resources/study-guides/az-104
- https://learn.microsoft.com/en-us/azure/storage/common/shared-key-authorization-prevent
- https://learn.microsoft.com/en-us/azure/storage/common/storage-network-security
- https://learn.microsoft.com/en-us/azure/storage/common/storage-network-security-limitations
- https://learn.microsoft.com/en-us/azure/storage/common/storage-network-security-virtual-networks
- https://learn.microsoft.com/en-us/azure/storage/common/storage-network-security-set-default-access
- https://learn.microsoft.com/en-us/azure/virtual-network/virtual-network-service-endpoints-overview
- https://learn.microsoft.com/en-us/azure/storage/common/storage-private-endpoints
- https://learn.microsoft.com/en-us/azure/storage/common/storage-sas-overview
- https://learn.microsoft.com/en-us/azure/storage/common/storage-account-keys-manage
- https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles/storage
- https://learn.microsoft.com/en-us/rest/api/storageservices/create-account-sas
- https://learn.microsoft.com/en-us/azure/storage/blobs/storage-blob-user-delegation-sas-create-cli
- https://learn.microsoft.com/en-us/azure/storage/common/sas-expiration-policy
- https://learn.microsoft.com/en-us/cli/azure/storage/account
- https://learn.microsoft.com/en-us/rest/api/storageservices/create-user-delegation-sas
- https://learn.microsoft.com/en-us/azure/storage/blobs/data-lake-storage-introduction
- https://learn.microsoft.com/en-us/rest/api/storageservices/define-stored-access-policy
- https://learn.microsoft.com/en-us/cli/azure/storage/container/policy
- https://learn.microsoft.com/en-us/cli/azure/storage/container
- https://learn.microsoft.com/en-us/azure/storage/files/storage-files-active-directory-overview
- https://learn.microsoft.com/en-us/azure/storage/files/storage-files-planning
- https://learn.microsoft.com/en-us/azure/storage/files/storage-files-identity-ad-ds-enable
- https://learn.microsoft.com/en-us/azure/storage/files/storage-files-identity-auth-hybrid-identities-enable
- https://learn.microsoft.com/en-us/azure/storage/files/storage-files-identity-auth-hybrid-cloud-trust
- https://learn.microsoft.com/en-us/azure/storage/files/storage-files-identity-configure-file-level-permissions
- https://learn.microsoft.com/en-us/azure/storage/files/storage-files-identity-assign-share-level-permissions
- https://learn.microsoft.com/en-us/azure/storage/files/storage-how-to-use-files-windows
- https://learn.microsoft.com/en-us/azure/storage/files/files-managed-identities