Skip to main content
← Blog

Compared · AZ-104

Azure SAS types: account vs service vs user delegation

Three kinds of shared access signature, told apart by two questions: what key signed it, and how far does it reach?

Published

The short answer: a user delegation SAS is signed with a key obtained with Microsoft Entra credentials, so it is authorized through Microsoft Entra ID and Microsoft recommends it whenever a SAS is needed. A service SAS and an account SAS are both signed with the storage account key (Shared Key). The service SAS reaches a resource in one storage service (Blob, Queue, Table or Files); the account SAS can reach one or more services and adds service-level operations. Only a service SAS can be tied to a stored access policy, which is how you revoke it without regenerating the account keys.

The three types side by side

User delegation SASService SASAccount SAS
Signed withA user delegation key, requested with Microsoft Entra credentialsThe storage account keyThe storage account key
Authorized throughMicrosoft Entra IDShared KeyShared Key
ReachBlob (incl. Data Lake), Queue, Table or Files resourcesA resource in one serviceOne or more services, plus service-level operations
Stored access policyNot supported (ad hoc only)SupportedNot supported (ad hoc only)
Revoke early byRevoking user delegation keys, or removing the creator's role assignmentsChanging or deleting its stored access policy, or regenerating the keyRegenerating the account key that signed it
When Shared Key is disallowedStill permitted (Blob Storage)DeniedDenied
Microsoft's viewRecommended, "superior security"Use a stored access policyBroadest; keep it short-lived

Types, signing, reach and stored access policy support are from Microsoft's SAS overview; the Shared Key behaviour is from Prevent authorization with Shared Key, which lists the user delegation SAS as permitted for Blob Storage.

What a SAS is, in one paragraph

A SAS is a token appended to a storage resource URI. Its query parameters say what the client may touch, with which permissions, and until when; one parameter is a signature built from those values and signed with a key. Azure Storage checks that signature on every request and returns 403 if it doesn't match. The token is generated on the client side and isn't tracked by Azure Storage: there is no list of issued tokens and no API to revoke one token by itself. That is why the revocation row in the table matters so much.

User delegation SAS: signed with Entra credentials

To create one, a Microsoft Entra security principal first calls Get User Delegation Key, which needs a role that includes the generateUserDelegationKey action at the storage account, resource group or subscription scope. The key can be valid for up to seven days and can sign any number of SAS tokens in that time. The SAS can grant no more than the principal itself is allowed to do. Microsoft's REST reference gives two ways to revoke it: revoke the user delegation keys (the quickest way; every SAS signed with them stops working), or change the role assignments of the principal that created it. Because no account key is involved, the code that issues it never has to store one.

Service SAS: one service, and the only one with stored access policies

A service SAS is signed with the account key and delegates access to a resource in just one service: a blob or container, a queue, a table, or a file share. It can be ad hoc (start, expiry and permissions written into the token) or associated with a stored access policy defined on the container, queue, table or share. A SAS tied to a policy inherits the policy's start, expiry and permissions, so changing or deleting the policy revokes every SAS bound to it, without touching the account keys or any other SAS. Microsoft notes a limit of five stored access policies per container.

Account SAS: the broad one

An account SAS is also signed with the account key, but it can span one or more services in the account. It can do everything a service or user delegation SAS can, plus service-level operations such as Get/Set Service Properties and Get Service Stats, and some read, write and delete operations a service SAS can't. It must be ad hoc. The only way to kill an account SAS before it expires is to regenerate the key that signed it, which also breaks every other SAS and client using that key.

When to use which

  • Default choice, or the account has Shared Key disabled: user delegation SAS.
  • Must be able to revoke one partner's access early without regenerating keys, and Shared Key is allowed: service SAS tied to a stored access policy.
  • Needs service-level operations, or several services in one token: account SAS, short-lived and least-privilege.
  • The client has its own identity in your tenant: consider no SAS at all; an Azure RBAC role assignment avoids a bearer token.

For any type, Microsoft's best practices are the same: always use HTTPS, grant the fewest permissions on the fewest resources, use near-term expiry times on ad hoc tokens, and have a revocation plan ready. A SAS expiration policy on the account only warns (and logs, if logging is on) when someone creates a service or account SAS longer than the recommended interval; it doesn't expire existing tokens.

Exam traps

  • "Signed with Entra credentials" or "without the account key" means user delegation SAS. Both of the other types use the account key, however narrowly they are scoped.
  • Shared Key disabled. Service SAS and account SAS requests are denied, even with a stored access policy. Only the user delegation SAS keeps working.
  • Stored access policies are service SAS only. An answer that ties an account SAS or a user delegation SAS to a stored access policy is wrong.
  • Revoking one token. Azure doesn't track SAS tokens, so "find and revoke the leaked token" is never an option. Revocation is by policy, by key, or by role assignment.
  • Expiration policy isn't revocation. It warns about new long-lived tokens and does nothing to tokens already issued.
  • "Account SAS limited to the Blob service" is still an account SAS. Narrowing services and permissions doesn't change how it is signed.

Practice questions from our bank

Three AZ-104 questions. Try each before opening the answer.

  1. Question 1 · AZ-104 · Implement and manage storage

    Which statement correctly contrasts an account SAS with a service SAS in Azure Storage?

    • AAn account SAS can delegate access to one or more storage services, including service-level operations; a service SAS covers a resource in only one service.
    • BA service SAS can delegate access across Blob, Queue, Table, and Files at once, while an account SAS covers resources in only a single storage service.
    • CAn account SAS is secured with Microsoft Entra credentials, while a service SAS is secured with the storage account key and requires access to that key.
    • DAn account SAS can be associated with a stored access policy for revocation, while a service SAS has to be created as an ad hoc SAS with inline constraints.
    Show answer and explanation

    Answer: A) An account SAS can delegate access to one or more storage services, including service-level operations; a service SAS covers a resource in only one service.

    An account SAS is the broader type: it can span one or more storage services and include service-level operations. A service SAS is limited to a resource in a single service. Both are signed with the storage account key.

    • ACorrect. An account SAS delegates access to resources in one or more storage services and can include service-level operations such as Get/Set Service Properties. A service SAS delegates access to a resource in only one service (Blob, Queue, Table, or Files).
    • BIncorrect. This reverses the scopes. The account SAS is the one that can span multiple services. A service SAS is limited to one service.
    • CIncorrect. Both the account SAS and the service SAS are signed with the storage account key (Shared Key). Only the user delegation SAS is secured with Microsoft Entra credentials.
    • DIncorrect. This is reversed. Stored access policies are supported only for a service SAS. An account SAS or user delegation SAS has to be an ad hoc SAS.
  2. Question 2 · AZ-104 · Implement and manage storage

    You must give a partner time-limited read access to a blob container. Your security team plans to disallow Shared Key authorization on the storage account, and the SAS you issue must keep working after that change. Which type of SAS should you issue?

    • AA user delegation SAS signed with a key requested by an authorized security principal
    • BA service SAS associated with a stored access policy defined on the container
    • CAn account SAS scoped to the Blob service with only the read permission granted
    • DA service SAS with a near-term expiry time that allows only the HTTPS protocol
    Show answer and explanation

    Answer: A) A user delegation SAS signed with a key requested by an authorized security principal

    Service SAS and account SAS are both signed with the storage account key and authorized through Shared Key. Only a user delegation SAS, signed with a user delegation key obtained with Microsoft Entra credentials, keeps working when Shared Key authorization is disallowed.

    • ACorrect. A user delegation SAS is signed with a user delegation key created using Microsoft Entra credentials, and it is authorized through Microsoft Entra ID rather than Shared Key. It doesn't depend on the account keys, so it keeps working when Shared Key authorization is disallowed. Microsoft recommends this SAS type when possible.
    • BIncorrect. A stored access policy lets you revoke a service SAS without regenerating keys. However, a service SAS is still signed with the storage account key and authorized through Shared Key, so it would stop working once Shared Key is disallowed.
    • CIncorrect. Limiting services and permissions reduces exposure, but an account SAS is always signed with the storage account key. It depends on Shared Key authorization.
    • DIncorrect. A short expiry and HTTPS-only are good practice, but they don't change how the token is signed. A service SAS is still secured with the account key and relies on Shared Key.
  3. Question 3 · AZ-104 · Implement and manage storage

    You issued several ad hoc service SAS tokens, signed with the storage account key, for a blob container. One may have leaked, and you now need to invalidate all of them without regenerating the storage account keys. Which design would have made this possible?

    • AIssue service SAS tokens that reference a stored access policy on the container, then delete or modify that policy
    • BIssue account SAS tokens that reference a stored access policy defined at the storage account level
    • CConfigure a SAS expiration policy on the storage account and lower its interval to expire the existing tokens
    • DHave Azure Storage record each issued SAS token so you can look up and invalidate the leaked token by itself
    Show answer and explanation

    Answer: A) Issue service SAS tokens that reference a stored access policy on the container, then delete or modify that policy

    Associate a service SAS with a stored access policy on the container. Deleting or changing that policy revokes every SAS bound to it without regenerating the account keys. Account SAS and user delegation SAS can't use stored access policies.

    • ACorrect. A stored access policy is defined on the container, and a service SAS associated with it inherits the policy's constraints. Microsoft documents that stored access policies let you revoke permissions for a service SAS without regenerating the storage account keys.
    • BIncorrect. An account SAS must be an ad hoc SAS. Stored access policies are supported only for a service SAS and are defined on a container, table, queue or file share, not on the account.
    • CIncorrect. A SAS expiration policy only sets a recommended maximum validity interval. It raises a warning, and writes a log entry if logging is enabled, when someone creates a SAS that exceeds the interval. It doesn't invalidate tokens that already exist.
    • DIncorrect. SAS tokens are generated on the client side and aren't tracked by Azure Storage. No API lists or revokes individual tokens.

Where this comes up on the exams

AZ-104 tests SAS in its storage domain, under configuring access to storage: choosing a SAS type for a requirement, stored access policies, and what disabling Shared Key does to existing tokens.

Related Azure comparisons: Azure RBAC vs Microsoft Entra roles and Azure LRS vs ZRS vs GRS vs GZRS.

Sources

Facts checked against Microsoft Learn on November 14, 2026.

Frequently asked questions

What is the difference between an account SAS and a service SAS?

Both are signed with the storage account key. A service SAS delegates access to a resource in only one storage service. An account SAS can cover one or more services and can also delegate service-level operations such as Get/Set Service Properties.

What is a user delegation SAS?

A SAS signed with a user delegation key that a Microsoft Entra security principal requests with its Entra credentials. It is authorized through Microsoft Entra ID instead of Shared Key, and Microsoft recommends it whenever a SAS is used.

Which SAS types support stored access policies?

Only the service SAS. A user delegation SAS or an account SAS must be an ad hoc SAS, with its start, expiry and permissions written into the token.

How do you revoke an Azure SAS?

A service SAS tied to a stored access policy is revoked by changing or deleting the policy. A user delegation SAS is revoked by revoking the user delegation keys or changing the creator's role assignments. An ad hoc service or account SAS can only be revoked by regenerating the account key that signed it.

Does a SAS still work if Shared Key access is disabled?

A user delegation SAS does, because it is authorized with Microsoft Entra ID. Requests that use a service SAS or an account SAS are denied, because both are authorized with Shared Key.