azureblog.co.uk
← AZ-104 study plan
AZ-104 · Implement and manage storage

Configure access to storage

Control who and what can reach a storage account: the storage firewall, shared access signatures, stored access policies, access keys and identity-based access for Azure Files.

  • 20 min
  • 5 concepts
  • Try it yourself
  • 5-question check

Learn

Access to a storage account has two layers. The network layer decides where requests can come from. The authorisation layer decides who is allowed to do what once a request arrives.

For authorisation you can use Microsoft Entra ID with Azure RBAC (recommended), the account's access keys, or shared access signatures (SAS) that grant limited, time-bound access.

  1. 1

    Configure Azure Storage firewalls and virtual networks

    By default a storage account accepts requests from any network (authorisation is still required). In Networking you can allow only selected virtual networks and IP ranges, or disable public network access completely and use private endpoints.

    Allowing a subnet needs a service endpoint for Microsoft.Storage on that subnet. You can also let trusted Azure services through, such as Azure Backup.

    Remember: Firewall rules work alongside authorisation. A request must pass both.

  2. 2

    Create and use shared access signature (SAS) tokens

    A SAS is a token appended to a URL that grants specific permissions (such as read or write) to specific resources until an expiry time. There are three types: user delegation SAS (signed with Microsoft Entra credentials, recommended), service SAS (account key, one service) and account SAS (account key, one or more services).

    Use HTTPS only, short expiry times and the fewest permissions the client needs. A user delegation SAS can be valid for at most seven days.

    Remember: Azure Storage doesn't keep a list of SAS tokens it has issued, so plan how you'd revoke them.

  3. 3

    Configure stored access policies

    A stored access policy lives on a container, file share, queue or table and holds a start time, expiry and permissions. A service SAS can reference the policy instead of carrying those values itself.

    Change or delete the policy and every SAS linked to it changes or stops working, without rotating account keys. Each container can have up to five stored access policies. User delegation and account SAS can't use them.

    Remember: Stored access policy = revocable service SAS.

  4. 4

    Manage access keys

    Every account has two 512-bit access keys that give full access to everything in it. Two keys let you rotate one while apps use the other. Store keys in Azure Key Vault and rotate them regularly; you can set a key expiration policy as a reminder.

    Microsoft recommends using Entra ID instead. You can turn off shared key authorisation completely, which also blocks service and account SAS because they're signed with a key.

    Remember: Rotating a key breaks every SAS signed with it.

  5. 5

    Configure identity-based access for Azure Files

    Azure Files supports identity-based authentication over SMB with on-premises AD DS, Microsoft Entra Domain Services or Microsoft Entra Kerberos for hybrid identities.

    Access is set at two levels: share-level permissions through Azure RBAC roles such as Storage File Data SMB Share Contributor, and file and folder permissions through Windows ACLs (NTFS).

    Remember: Share-level role first, then NTFS permissions. Both must allow the action.

The three types of SAS

User delegation SAS
  • Signed with a user delegation key from Entra ID
  • Blob, Data Lake, Queue, Table, Files
  • Max 7 days
  • Recommended by Microsoft
Service SAS
  • Signed with an account key
  • One service
  • Can use a stored access policy
  • Revoke by changing the policy
Account SAS
  • Signed with an account key
  • One or more services
  • Allows some service-level operations
  • Revoke by rotating the key

Try it

Build a SAS for a partner who needs a report from a blob container. Change the type, permissions and expiry to see the token and how you'd revoke it.

This interactive part needs JavaScript.

In the portal

  • Restrict networksAzure portal: Storage accounts > your account > Security + networking > Networking
  • Generate a SAS for one blobAzure portal: Storage accounts > your account > Containers > your container > your blob > Generate SAS
  • Stored access policiesAzure portal: Storage accounts > your account > Containers > your container > Access policy
  • Rotate access keysAzure portal: Storage accounts > your account > Security + networking > Access keys

Key terms

Click a card to see the definition.

Check your understanding

5 questions. Score 80% or more and these skills are marked as confident in your AZ-104 study plan.

  1. Which SAS type does Microsoft recommend?

  2. You issued 50 service SAS tokens and need to revoke them without rotating keys. What should they have used?

  3. What happens to account SAS tokens if you rotate key1, which signed them?

  4. To allow a subnet in the storage firewall, what must the subnet have?

  5. Users access an Azure file share with AD DS identities but get access denied on a folder. Their share-level role is fine. What should you check?

Sources

Facts in this lesson are from Microsoft Learn. This site isn't affiliated with Microsoft.