Implement and Manage Storage · Topic 1 of 3
Configure Access to Storage
AZ-104 storage access: storage firewalls and virtual networks, SAS types, stored access policies, access keys and identity based access for Azure Files.
- 6 min
- A firewall set to selected networks denies all others. Subnets need a service endpoint. IP rules take public IPv4 ranges only.
- A private endpoint gives the account a private IP in your virtual network.
- A user delegation SAS is signed with Entra credentials and is the most secure.
What it is
Access to a storage account is controlled at two levels. The network level decides which clients can reach the account at all. The authorization level decides what a client that reaches it may do.
For authorization you can use Microsoft Entra ID and RBAC, a shared access signature (SAS), or the account access keys.
How it works
Storage firewalls and virtual networks
By default a storage account accepts connections from any network. In the Networking settings you can change this to accept connections only from selected virtual networks and IP addresses. Everything else is denied.
- Virtual network rules allow chosen subnets. The subnet needs a service endpoint for Microsoft.Storage.
- IP rules allow public IPv4 address ranges. Private address ranges cannot be used in IP rules.
- Exceptions can allow trusted Microsoft services, such as Azure Backup, to reach the account.
- A private endpoint gives the account a private IP address in your virtual network, so traffic never uses the public endpoint.
Shared access signatures
A SAS is a URL token that grants limited access for a limited time. It defines which resource, which permissions, the start and expiry time, and optionally the allowed IP addresses and protocol.
| Type | Signed with | Covers |
|---|---|---|
| User delegation SAS | Microsoft Entra credentials | Blob Storage. The most secure type |
| Service SAS | The account key | One storage service |
| Account SAS | The account key | One or more storage services |
The identity that creates a user delegation SAS needs an Azure role that allows it to request a user delegation key.
Stored access policies
A stored access policy defines the start time, expiry and permissions of a SAS in one place, on a container, share, queue or table. A service SAS can then refer to the policy. You can set up to five policies at a time on one resource.
The benefit is control. To revoke every SAS linked to a policy, delete the policy or change its expiry to a time in the past. A SAS that has no stored access policy cannot be revoked, except by regenerating the account key that signed it. A stored access policy does not work with an account SAS.
Access keys
Each storage account has two access keys. Either key gives full access to everything in the account. Two keys exist so that you can rotate without downtime: switch applications to key 2, then regenerate key 1.
Keep keys in Azure Key Vault, rotate them regularly and avoid them where possible. You can turn off key authorization for the account so that only Microsoft Entra authorization is accepted. Regenerating a key also invalidates every SAS that was signed with it.
Identity based access for Azure Files
Azure Files over SMB can use identities instead of the account key. The identity source can be on premises Active Directory Domain Services, Microsoft Entra Domain Services, or Microsoft Entra Kerberos for hybrid identities.
Access is then checked at two levels.
- Share level: an Azure role such as Storage File Data SMB Share Contributor, assigned to the user or group.
- File and folder level: the usual Windows ACL permissions on the files themselves.
Choosing an authorization method
| Method | Best when |
|---|---|
| Microsoft Entra ID with an RBAC data role | Users and applications can sign in. This is the recommended choice |
| User delegation SAS | You must hand limited, time-bound access to blob data to someone without an account |
| Service SAS with a stored access policy | You need access you can revoke later, for one service |
| Account key | Only as a last resort, and never in application code |
What a SAS URL contains
A SAS is appended to the resource URL as parameters.
https://contoso.blob.core.windows.net/docs/report.pdf?sv=2022-11-02&sp=r&se=2026-12-31T00:00:00Z&sr=b&sig=<signature>
sp lists the permissions, se is the expiry time, sr is the resource type and sig is the signature. A user delegation SAS can be created from the command line with the --as-user option.
Troubleshooting a 403 error
When a client reaches the account but is refused, check these causes in order.
| Cause | Fix |
|---|---|
| The storage firewall does not allow the client | Add the subnet, IP range or a private endpoint |
| The SAS has expired or lacks the permission | Issue a new one with the right expiry and permissions |
| The user has no data role | Assign a role such as Storage Blob Data Reader |
| Key authorization was turned off | Use Entra ID or a user delegation SAS |
How the exam asks about this
- "Revoke a SAS you have already issued." Delete the stored access policy, or regenerate the key if there is none.
- "Allow only a virtual network to reach the account." A firewall rule with a service endpoint.
- "Reach the account over a private address." A private endpoint.
- "Which SAS is signed with Entra credentials?" The user delegation SAS.
- Azure Files access with identities needs a share-level role and file-level ACLs.
What to remember for the exam
- A firewall set to selected networks denies all others. Subnets need a service endpoint. IP rules take public IPv4 ranges only.
- A private endpoint gives the account a private IP in your virtual network.
- A user delegation SAS is signed with Entra credentials and is the most secure.
- Stored access policies allow up to five per resource and make a service SAS revocable.
- A SAS without a policy can be revoked only by regenerating the key.
- Two keys allow rotation. Both give full access.
- Azure Files identity access uses an Azure role for the share and ACLs for files.
"Revoke a SAS you already gave out" points to a stored access policy. "No account key in the code" points to Entra authorization or a user delegation SAS.
Common mistakes
Putting a private IP range in an IP rule. Only public addresses are accepted. Use a service endpoint or private endpoint instead.
Assuming key rotation is harmless. Regenerating a key breaks every client and SAS that uses it.
Linking a stored access policy to an account SAS. It works only with a service SAS.
Giving share permission only. Windows ACLs still apply to the files inside.
Check yourself
Which SAS type is signed with Microsoft Entra credentials instead of the account key?
A user delegation SAS.
How can you revoke a service SAS you already issued?
Delete or expire the stored access policy it refers to.
What must a subnet have before a storage firewall can allow it?
A service endpoint for Microsoft.Storage.
Topic 1 of 3 in Implement and Manage Storage
Test yourself on Implement and Manage Storage
The full Microsoft AZ-104 question bank has 650 questions, with timed practice exams and an explanation for every answer.
This study guide is independent and is not affiliated with, endorsed by, or sponsored by Microsoft. Vendor names, certification names and exam codes are trademarks of their respective owners and are used for identification only.