Delegating Access with Shared Access Signatures
A shared access signature grants limited, time-bound access to storage. This lesson explains the SAS types, their parameters and how they are revoked.
Learning outcomes
After completing this lesson, you will be able to:
- Distinguish between user delegation, service and account SAS.
- Describe the main SAS parameters.
- Explain how each type of SAS is revoked.
Types of SAS
A SAS is a query string appended to a resource URI, such as https://stcontoso.blob.core.windows.net/docs/a.pdf?sv=...&sp=r&se=...&sig=.... Azure Storage supports three types. A user delegation SAS is signed with a user delegation key that a Microsoft Entra security principal requests with generateUserDelegationKey permission, applies to Blob Storage and Data Lake Storage only, and is limited to the permissions of that principal; it is the recommended type because no account key is involved. A service SAS is signed with an account key and grants access to resources in one service: blobs, files, queues or tables. An account SAS is signed with an account key and can grant access to resources in several services and to service-level operations such as getting service properties.
The following diagram shows a user delegation SAS that shares one blob for 48 hours, and its parameters.

Which SAS type?
SAS parameters
The parameters define what the token allows. sp lists permissions such as read (r), add (a), create (c), write (w), delete (d) and list (l). st and se set the start and expiry times in UTC. sip limits the client IP addresses, and spr=https requires HTTPS. sr gives the resource (blob, container, share and so on) for service SAS, and ss and srt give services and resource types for account SAS. si references a stored access policy, and sig is the signature that prevents tampering.
SAS tokens are generated in the portal on the account's Shared access signature page (account SAS), on a container's or blob's Generate SAS page (choosing the account key, a stored access policy or user delegation key), in Storage Explorer, or with az storage blob generate-sas --as-user --auth-mode login for a user delegation SAS. A SAS expiration policy on the account sets a recommended maximum validity, and Azure Monitor logs record SAS use that exceeds it.
Reading a SAS token
Risks and revocation
Anyone holding a SAS URL can use it until it expires, so tokens should have the minimum permissions, short expiry times, HTTPS only and, where possible, IP restrictions. A key-signed ad hoc SAS cannot be revoked individually: the only way is to rotate the account key that signed it, which also invalidates every other SAS and client using that key. That is why service SAS tokens are often tied to a stored access policy, covered in the next topic. A user delegation SAS is limited to seven days and is revoked by revoking all user delegation keys or by removing the principal's data role.
Revoking a SAS
Sharing a file securely
A partner must download one blob, contracts/q4.pdf, during the next 48 hours from their office address. The company has disabled storage account key access on the account. Which SAS should you create, and with which parameters?
With key access disabled, only a user delegation SAS can be issued, signed with Microsoft Entra credentials of a principal that has a Storage Blob Data role. Create it for the blob (sr=b) with read permission only (sp=r), an expiry 48 hours ahead, spr=https and the partner's public IP in sip. A service or account SAS requires an account key, so it cannot be created on this account.
Which SAS type is signed without an account key?
Show answer
The user delegation SAS, signed with a key obtained with Microsoft Entra credentials.
Exam Tips
Remember for the exam
- Prefer a user delegation SAS for blobs; it uses Microsoft Entra credentials, not account keys.
- Service SAS: one service; account SAS: several services and service-level operations.
- A key-signed ad hoc SAS is revoked only by rotating the key.
- Limit SAS tokens with permissions, expiry, HTTPS and IP restrictions.