AZ-104Chapter 76 of 168Objective 2.3

SAS Token Types: Account, Service, User Delegation

This chapter covers the three types of Shared Access Signature (SAS) tokens used with Azure Storage: Account SAS, Service SAS, and User Delegation SAS. These tokens provide delegated, time-limited access to storage resources without exposing account keys. On the AZ-104 exam, roughly 10–15% of storage-related questions involve SAS tokens, especially their differences, appropriate use cases, and security implications. Understanding when to use each type and how to generate them is critical for both the exam and real-world Azure administration.

25 min read
Intermediate
Updated May 31, 2026

Three Keys for Your Storage Unit

Imagine you own a large storage facility with multiple units (containers), each containing boxes (blobs). You want to give different people access to different parts of the facility without handing over your master key. You have three types of keys:

1.

Account Key: This is the master key that opens every unit and every box. It can unlock the entire facility, including the office (account-level operations). If you give this key to someone, they can do anything: read, write, delete any box in any unit. This is powerful but dangerous if lost.

2.

Service Key: This key is specific to one unit (container). It can open that unit and any box inside it, but not other units. You can also set an expiry time on the key. This is like giving a friend a key to your storage unit for a weekend—they can access only that unit, and after Sunday the key stops working.

3.

User Delegation Key: This is like a temporary key that you get from the facility manager (Azure AD) after proving your identity. It works only for your own unit and only for a limited time (e.g., 7 hours). You can give copies of this key to others, but they must also be authorized by the manager. This is more secure because the key is tied to your identity and expires quickly.

In each case, the key includes a set of permissions (read, write, delete) that are written directly on the key. The storage facility checks the key's permissions and expiry before allowing access. If the key is expired or doesn't have the right permissions, access is denied. The three key types differ in scope, lifetime, and how they are obtained.

How It Actually Works

A Shared Access Signature (SAS) is a URI that grants granular, time-limited access to Azure Storage resources. It allows you to delegate access to a storage account's containers, blobs, queues, tables, or files without sharing the account key. The SAS token is appended to the storage resource URL as a query string parameter. The token contains all the necessary information for the storage service to authenticate the request: the target resource, permissions, expiry time, allowed IP addresses, and protocol (HTTPS only or HTTP/HTTPS).

SAS tokens are essential for scenarios where you need to provide temporary access to storage data, such as:

Allowing a mobile app to upload images directly to a blob container.

Providing a download link for a file that expires after 24 hours.

Enabling a batch processing job to read from a queue for a limited period.

The three SAS types differ in scope, how they are generated, and their security properties.

Account SAS

An Account SAS is generated using the storage account key. It delegates access to one or more storage services (Blob, Queue, Table, File) at the account level. The token applies to all resources within the specified services, including containers, blobs, queues, tables, and shares. You can also include operations that are not permitted with a Service SAS, such as creating or deleting containers, listing containers, and setting container metadata.

How it works internally: 1. You create a string-to-sign that includes the signed permissions (e.g., r, w, d), signed services (b for Blob, q for Queue, t for Table, f for File), signed resource types (s for service-level, c for container-level, o for object-level), signed expiry time (ISO 8601 UTC), signed start time (optional), signed IP range (optional), signed protocol (https only or https,http), and the storage account version. 2. You sign this string with the storage account key (either primary or secondary) using HMAC-SHA256. 3. The resulting signature is appended to the URI as the 'sig' query parameter. 4. When a request arrives, the storage service reconstructs the string-to-sign from the request parameters and verifies the signature using the account key. If the signature matches and the token is not expired, the request is authorized.

Key components and defaults: - SignedServices: 'b' (blob), 'q' (queue), 't' (table), 'f' (file). You can combine, e.g., 'bq' for blob and queue. - SignedResourceTypes: 's' (service – e.g., get service properties), 'c' (container – e.g., create container), 'o' (object – e.g., read blob). - SignedPermission: 'r' (read), 'w' (write), 'd' (delete), 'l' (list), 'a' (add), 'c' (create), 'u' (update), 'p' (process). The permissions depend on the resource type. - SignedExpiry: Required. Maximum validity is 7 days from creation if no stored access policy is used. With a stored access policy, the expiry can be longer but is limited by the policy. - SignedStart: Optional. If omitted, the token is valid immediately. - SignedIP: Optional. Restricts requests to specific IP addresses or ranges (e.g., 192.168.1.0/24). - SignedProtocol: 'https' (default) or 'https,http'. HTTPS is recommended. - SignedVersion: Must match the storage service version (e.g., '2021-04-10').

Example Account SAS URL:

https://myaccount.blob.core.windows.net/?sv=2021-04-10&ss=b&srt=sco&sp=rwdl&se=2025-12-31T23:59:59Z&sig=...

Configuration and verification: - Generate via Azure Portal: Storage account → Shared access signature → Configure permissions → Generate SAS. - Generate via Azure CLI:

az storage account generate-sas --account-name myaccount --services b --resource-types sco --permissions rwdl --expiry 2025-12-31T23:59:59Z --https-only

Generate via PowerShell:

New-AzStorageAccountSASToken -Service Blob -ResourceType Service,Container,Object -Permission "rwdl" -ExpiryTime (Get-Date).AddDays(7)

Service SAS

A Service SAS is generated using the storage account key or a stored access policy. It delegates access to a specific resource (container, blob, queue, table, file share) and its children. Unlike Account SAS, it cannot perform service-level operations like listing all containers. It is scoped to a single container or blob.

How it works internally: 1. The string-to-sign includes the same fields as Account SAS but also includes the resource URI (canonicalized resource) and optionally a stored access policy identifier. 2. The signature is computed using the account key or the policy key. 3. The token is appended to the resource URL, e.g., for a blob:

https://myaccount.blob.core.windows.net/mycontainer/myblob.txt?sv=2021-04-10&se=2025-12-31T23:59:59Z&sr=b&sp=r&sig=...

Key differences from Account SAS: - Scope: Single container or blob (not account-level). - Cannot perform service-level operations (e.g., list containers). - Can be associated with a stored access policy for easier management and revocation.

Stored Access Policy: A stored access policy is a set of permissions and expiry defined on a container, queue, table, or file share. When a Service SAS is created with a reference to a policy, the token inherits the policy's permissions and expiry. The policy can be modified or deleted to revoke all SAS tokens associated with it. This is a key security feature: without a policy, the only way to revoke a SAS is to regenerate the account key, which invalidates all SAS tokens and applications using that key.

Default values: - Maximum SAS token validity without a stored access policy: 7 days. - With a stored access policy: limited by the policy's expiry (can be up to the policy's expiry, which itself has no hard limit but should be reasonable).

Configuration and verification: - Generate via Azure Portal: Storage account → Containers → Container → Shared access tokens → Configure → Generate. - Generate via Azure CLI:

az storage container generate-sas --account-name myaccount --name mycontainer --permissions rwdl --expiry 2025-12-31T23:59:59Z --https-only

Generate via PowerShell:

New-AzStorageContainerSASToken -Name mycontainer -Permission rwdl -ExpiryTime (Get-Date).AddDays(7)

User Delegation SAS

A User Delegation SAS is the most secure SAS type. It is secured with Azure AD credentials and does not require the storage account key. Instead, you first obtain a user delegation key from Azure AD by authenticating with a user or service principal that has the appropriate RBAC role (e.g., Storage Blob Data Contributor). The user delegation key is then used to sign the SAS token.

How it works internally: 1. The client authenticates with Azure AD (e.g., using az login or managed identity). 2. The client requests a user delegation key from the storage service via a REST API call (e.g., POST https://myaccount.blob.core.windows.net/?restype=service&comp=userdelegationkey). The request must be authorized with an Azure AD token. 3. The storage service returns a user delegation key that includes:

- SignedOid: Object ID of the Azure AD user/principal that requested the key. - SignedTid: Tenant ID of the Azure AD tenant. - SignedStart: Start time of the key. - SignedExpiry: Expiry time of the key (maximum 7 days from start). - SignedService: 'b' (blob), 'd' (datalake), 'f' (file). Note: User Delegation SAS currently supports only Blob storage (including Data Lake Storage Gen2) and File storage. - SignedVersion: Storage version. - Value: The actual key material (a base64-encoded string). 4. The client then creates a string-to-sign for the SAS token, including the user delegation key's fields (SignedOid, SignedTid, SignedStart, SignedExpiry, SignedService, SignedVersion) plus the SAS-specific fields (permissions, resource, expiry, etc.). 5. The client signs the string with the user delegation key's Value (using HMAC-SHA256) to produce the signature. 6. The resulting SAS token is appended to the blob URL.

Key differences from Account/Service SAS: - No account key exposure: The storage account key is never used. - Azure AD integration: The SAS is tied to the identity that requested the user delegation key. The key expires after a maximum of 7 days, and the SAS token cannot exceed the key's validity. - Supported services: Blob (including Data Lake Storage Gen2) and File storage only (not Queue or Table). - Revocation: Revoking the user delegation key is not directly possible; you must change the RBAC role assignment or wait for the key to expire. However, the key is short-lived (max 7 days).

Default values and limits: - User delegation key maximum lifetime: 7 days. - SAS token maximum lifetime: 7 days (cannot exceed the key's expiry). - The user delegation key is cached by the client; the storage service does not maintain a session. The key is valid until its expiry, regardless of RBAC changes (except if the storage account key is regenerated, but that does not affect user delegation keys).

Configuration and verification: - Generate via Azure CLI:

# First obtain a user delegation key (requires authenticated Azure AD session)
az storage container generate-sas --account-name myaccount --name mycontainer --permissions rwdl --expiry 2025-12-31T23:59:59Z --auth-mode login --as-user

Generate via .NET SDK:

UserDelegationKey key = await blobServiceClient.GetUserDelegationKeyAsync(DateTimeOffset.UtcNow, DateTimeOffset.UtcNow.AddDays(7));
BlobSasBuilder sasBuilder = new BlobSasBuilder()
{
    BlobContainerName = "mycontainer",
    Resource = "c",
    ExpiresOn = DateTimeOffset.UtcNow.AddDays(7)
};
sasBuilder.SetPermissions(BlobContainerSasPermissions.Read | BlobContainerSasPermissions.Write);
string sasToken = sasBuilder.ToSasQueryParameters(key, accountName).ToString();

Interaction with Related Technologies

Stored Access Policy: Only applies to Service SAS and Account SAS (for some operations). User Delegation SAS does not support stored access policies because it is already tied to an Azure AD identity.

Azure AD RBAC: User Delegation SAS requires the principal to have the Microsoft.Storage/storageAccounts/blobServices/generateUserDelegationKey/action permission (granted via roles like Storage Blob Data Contributor, Storage Blob Data Owner, or a custom role).

Firewall and Virtual Networks: SAS tokens can be restricted to specific IP addresses or subnets using the SignedIP field. For User Delegation SAS, the IP restriction is part of the SAS token itself, not the user delegation key.

Azure Policy: Can enforce that SAS tokens must be created with HTTPS only, limit maximum expiry, or require User Delegation SAS over account key-based SAS.

Security Considerations

Account SAS: Most powerful but also most dangerous. If an account SAS is leaked, an attacker can access all services and resources until the token expires or the account key is regenerated. Use only when necessary and with the shortest possible expiry.

Service SAS: More scoped, but still uses the account key. Can be revoked via stored access policy.

User Delegation SAS: Most secure because it does not expose the account key. However, it requires Azure AD integration and is limited to Blob/File. It is the recommended approach for modern applications.

Exam Tips

Know that User Delegation SAS is only for Blob and File storage (not Queue or Table).

Remember that Account SAS can include service-level operations (e.g., list containers), while Service SAS cannot.

The maximum SAS token validity without a stored access policy is 7 days for Account and Service SAS. With a policy, it can be longer (but the policy itself can be set to any expiry).

User Delegation SAS has a maximum lifetime of 7 days (both key and token).

Stored access policies can be used to revoke Service SAS tokens without regenerating the account key.

Walk-Through

1

Identify the access need

Determine what resource needs to be accessed (account-level, container, or blob), for how long, and with what permissions. Also consider whether the client can authenticate with Azure AD. If the client can use Azure AD, prefer User Delegation SAS for Blob/File. If not, choose between Account and Service SAS based on scope. For example, if you need to allow a user to list all containers in an account, you must use Account SAS because Service SAS cannot do that. If you only need access to a single blob, Service SAS is more scoped and thus more secure.

2

Choose the SAS type

Select Account SAS for account-level operations (e.g., list containers, create containers) or when multiple services are needed. Select Service SAS for granular access to a single container or blob. Select User Delegation SAS when you want to avoid using the account key and the client can authenticate with Azure AD. Note: User Delegation SAS is only available for Blob and File storage. If the resource is a queue or table, you must use Account or Service SAS.

3

Define permissions and constraints

Specify the exact permissions (read, write, delete, list, etc.) required. Set the expiry time as short as possible. Optionally restrict to specific IP addresses or subnets, and enforce HTTPS only. For Service SAS, consider creating a stored access policy first to allow future revocation. For User Delegation SAS, the user delegation key expiry must be set (max 7 days), and the SAS token expiry cannot exceed that. The RBAC role must grant the 'generateUserDelegationKey' action.

4

Generate the SAS token

Use Azure Portal, CLI, PowerShell, or SDK to generate the token. For Account and Service SAS, the signing key is the storage account key. For User Delegation SAS, first obtain a user delegation key using an Azure AD-authenticated call, then sign the SAS with that key. The resulting token is a query string that includes the signature and all parameters. Example for Service SAS: `https://myaccount.blob.core.windows.net/mycontainer/myblob.txt?sv=2021-04-10&se=2025-12-31T23:59:59Z&sr=b&sp=r&sig=...`

5

Distribute the SAS token

Provide the full URL with the SAS token to the client application. The client must use HTTPS (if enforced) and include the token in every request. The token is typically passed as a query parameter. The client does not need the account key or Azure AD credentials (for Account/Service SAS). For User Delegation SAS, the client does not need the user delegation key after the token is generated; the token itself contains enough information for the storage service to verify it.

6

Monitor and revoke if needed

For Account and Service SAS without a stored access policy, the only way to revoke is to regenerate the storage account key, which invalidates all SAS tokens and applications using that key. For Service SAS with a stored access policy, you can modify or delete the policy to revoke tokens. For User Delegation SAS, revocation is not directly possible; you must wait for the key to expire (max 7 days) or change the RBAC role assignment (which does not invalidate already-issued tokens but prevents new ones from being generated). Therefore, always use short expiry times.

What This Looks Like on the Job

Enterprise Scenario 1: Mobile App Image Upload

A company has a mobile app that allows users to upload profile pictures directly to Azure Blob Storage. The app backend generates a SAS token for each upload request. The token is scoped to a specific container (e.g., 'profile-pics') with write permission only, and expires after 5 minutes. This prevents users from overwriting other files or accessing the storage account. The backend uses a Service SAS with a stored access policy on the container. The policy sets the maximum expiry to 1 hour, but the token itself is short-lived. If a user's token is intercepted, the attacker has only 5 minutes to upload a malicious file, and the token only allows writes to that container. The stored access policy allows the admin to revoke all tokens by updating the policy. In production, the backend handles millions of requests daily. The key consideration is performance: generating a SAS token is a simple cryptographic operation, so it does not become a bottleneck. However, the backend must securely store the account key (for Service SAS) or use managed identity with User Delegation SAS for better security. The team chose Service SAS over User Delegation SAS because the app does not use Azure AD authentication for end users. Misconfiguration: if the token's expiry is too long (e.g., 1 day), a leaked token could be used for a longer time. The fix is to always use the shortest possible expiry.

Enterprise Scenario 2: Data Lake Analytics Job

A data engineering team runs Azure Synapse Analytics jobs that read from Data Lake Storage Gen2 (which is built on Blob Storage). The jobs need to read multiple containers but not write. The team uses an Account SAS with read and list permissions for the entire storage account, valid for 24 hours. This is necessary because the job needs to list containers and read blobs across multiple containers. A Service SAS would not work because it cannot list containers. The token is generated by a DevOps pipeline using the storage account key stored in Azure Key Vault. The token is passed to the Synapse job as a configuration parameter. The team ensures the token is only valid for the duration of the job (24 hours) and is restricted to the IP range of the Synapse workspace. A common mistake is to use a Service SAS and then try to list containers, which fails. Another mistake is to set the expiry too long (e.g., 30 days) for convenience, which increases risk. The team also implements monitoring: if the token is used from an unexpected IP, an alert is triggered.

Enterprise Scenario 3: Third-Party Data Export

A company needs to provide a third-party vendor with temporary access to download a specific blob (a monthly report). The vendor does not have Azure AD accounts. The company uses a Service SAS with read permission on the blob, expiring in 7 days (the maximum without a stored access policy). The token is sent via a secure email. The vendor uses a tool like Azure Storage Explorer to download the file. The company creates a stored access policy on the container with the same permissions and expiry, then generates the SAS token referencing that policy. This allows the company to revoke access early if needed by deleting the policy. A common error is to generate the SAS without a policy, making revocation impossible without regenerating the account key. Another issue: the vendor might share the token; to mitigate, the company restricts the token to the vendor's IP address range. If the vendor's IP changes, the token becomes invalid, requiring a new one. The company also logs all SAS usage via Azure Storage analytics logs.

How AZ-104 Actually Tests This

The AZ-104 exam tests your understanding of SAS tokens under objective 'Manage Azure storage' (2.3). Specific sub-objectives include: 'Generate shared access signatures' and 'Configure stored access policies'. Expect 1-3 questions on this topic. The exam focuses on:

1.

Which SAS type to use in a given scenario. You must know the differences in scope and capabilities. For example, if the requirement is to allow a user to list all containers in a storage account, you must choose Account SAS. If the requirement is to allow access to a single file for 24 hours, Service SAS is appropriate. If the requirement is to avoid using the account key and the resource is a blob, User Delegation SAS is best.

2.

Maximum expiry times. The exam tests that without a stored access policy, the maximum SAS token validity is 7 days for Account and Service SAS. With a stored access policy, it can be longer. User Delegation SAS has a maximum of 7 days for both the key and the token.

3.

Revocation methods. The exam asks how to revoke a SAS token. Answer: For Service SAS with a stored access policy, modify or delete the policy. For Account SAS or Service SAS without a policy, regenerate the account key. User Delegation SAS cannot be revoked; you must wait for expiry or change RBAC.

4.

Stored access policy benefits. The exam emphasizes that stored access policies allow revocation without regenerating the account key and allow longer expiry times.

Common wrong answers: - Choosing Service SAS when account-level operations are needed (e.g., list containers). Candidates think 'Service SAS' is broader, but it is actually scoped to a single resource. - Choosing User Delegation SAS for queues or tables. Candidates forget that User Delegation SAS only supports Blob and File. - Believing that User Delegation SAS can be revoked by deleting the user delegation key. In reality, the key is signed and cached; revocation is not possible. - Thinking that the maximum SAS token validity is always 7 days. This is true only without a stored access policy. With a policy, it can be longer.

Numbers/values to memorize: - Maximum SAS validity without policy: 7 days. - User delegation key maximum lifetime: 7 days. - User delegation SAS services: Blob (including Data Lake Storage Gen2) and File. - Account SAS resource types: service (s), container (c), object (o).

Edge cases: - A SAS token with a start time in the future is not valid until that time. - If a stored access policy is modified, existing SAS tokens referencing that policy inherit the new permissions and expiry immediately. - If a stored access policy is deleted, all SAS tokens referencing it become invalid. - User Delegation SAS does not support stored access policies.

How to eliminate wrong answers: - If the question mentions 'list containers' or 'create container', the answer must involve Account SAS (or a stored access policy is not relevant). - If the question mentions 'avoid exposing account key', look for User Delegation SAS (if Blob/File) or Service SAS with stored access policy (if not). - If revocation is a concern, the answer must involve a stored access policy (for Service SAS) or mention that User Delegation SAS cannot be revoked. - If the resource is a queue or table, User Delegation SAS is never the answer.

Key Takeaways

There are three SAS types: Account SAS, Service SAS, and User Delegation SAS. Each has different scope and security properties.

Account SAS can perform account-level operations (e.g., list containers); Service SAS cannot.

User Delegation SAS is the most secure and does not use the storage account key, but only supports Blob and File storage.

Without a stored access policy, the maximum SAS token validity is 7 days for Account and Service SAS.

Stored access policies allow revocation of Service SAS tokens without regenerating the account key.

User Delegation SAS has a maximum lifetime of 7 days (both the user delegation key and the SAS token).

To revoke a User Delegation SAS, you must wait for expiry or change RBAC assignments (does not invalidate existing tokens).

Always use HTTPS when generating SAS tokens to protect the token in transit.

Restrict SAS tokens to specific IP addresses when possible to limit exposure.

Use the shortest possible expiry time for any SAS token to minimize risk of misuse.

Easy to Mix Up

These come up on the exam all the time. Here's how to tell them apart.

Account SAS

Scope: Entire storage account (all services and resources).

Can perform account-level operations (e.g., list containers, create containers).

Cannot be associated with a stored access policy for revocation.

Maximum validity without policy: 7 days.

Uses storage account key for signing.

Service SAS

Scope: Single container, blob, queue, table, or file share.

Cannot perform account-level operations.

Can be associated with a stored access policy for easy revocation.

Maximum validity without policy: 7 days; with policy: up to policy expiry.

Uses storage account key (or policy key) for signing.

Service SAS

Scope: Single container or blob.

Uses storage account key (exposes key indirectly).

Supports all storage services (Blob, Queue, Table, File).

Can be revoked via stored access policy.

Maximum validity without policy: 7 days.

User Delegation SAS

Scope: Single container or blob (only Blob and File).

Uses Azure AD credentials; no account key exposure.

Supports only Blob and File storage (including Data Lake Storage Gen2).

Cannot be revoked; must wait for expiry (max 7 days).

Maximum validity: 7 days (both key and token).

Watch Out for These

Mistake

A Service SAS can perform account-level operations like listing containers.

Correct

A Service SAS is scoped to a single container or blob. It cannot list containers or perform other account-level operations. Only an Account SAS can do that.

Mistake

User Delegation SAS can be used for Azure Queue Storage.

Correct

User Delegation SAS is only supported for Blob Storage (including Data Lake Storage Gen2) and File Storage. For queues and tables, you must use Account or Service SAS.

Mistake

The maximum lifetime of any SAS token is 7 days.

Correct

This is true only for SAS tokens without a stored access policy. With a stored access policy, the token can be valid for longer (the policy's expiry). User Delegation SAS also has a maximum of 7 days for both the key and token.

Mistake

You can revoke a User Delegation SAS by deleting the user delegation key.

Correct

The user delegation key is a signed token that is cached by the client. There is no API to revoke it. The only way to prevent further use is to wait for expiry or change RBAC assignments (which does not invalidate already-issued SAS tokens).

Mistake

A stored access policy can be used with an Account SAS.

Correct

Stored access policies are defined on a container, queue, table, or file share, not at the account level. Therefore, they can only be used with Service SAS (or with Account SAS for specific resource-level operations, but not for service-level operations).

Do You Actually Know This?

Reveal each answer, then mark whether you got it right. Score 60%+ to unlock the next chapter.

Frequently Asked Questions

What is the difference between Account SAS and Service SAS on the AZ-104 exam?

Account SAS applies to the entire storage account and can perform service-level operations like listing containers. Service SAS is scoped to a single container or blob and cannot list containers. On the exam, if the requirement involves account-level operations (e.g., create container, list containers), the answer is Account SAS. If it's for a specific blob or container, Service SAS is appropriate. Also, Account SAS cannot use stored access policies for revocation, while Service SAS can.

Can I use User Delegation SAS for Azure Queue Storage?

No. User Delegation SAS is only supported for Azure Blob Storage (including Data Lake Storage Gen2) and Azure File Storage. For queues, you must use Account SAS or Service SAS. This is a common exam trap: if the question mentions a queue, eliminate User Delegation SAS immediately.

How long can a SAS token be valid without a stored access policy?

Without a stored access policy, the maximum validity for an Account SAS or Service SAS is 7 days from the start time. With a stored access policy, the token can be valid for a longer period, limited by the policy's expiry. User Delegation SAS tokens are also limited to a maximum of 7 days (the user delegation key itself cannot exceed 7 days).

How do I revoke a SAS token?

For a Service SAS that uses a stored access policy, you can modify or delete the policy to revoke all tokens associated with it. For an Account SAS or a Service SAS without a policy, you must regenerate the storage account key (either primary or secondary), which invalidates all SAS tokens signed with that key. User Delegation SAS cannot be revoked; you must wait for the token to expire or change RBAC role assignments (which does not invalidate already-issued tokens).

What permissions do I need to generate a User Delegation SAS?

To generate a User Delegation SAS, the Azure AD principal must have the 'Microsoft.Storage/storageAccounts/blobServices/generateUserDelegationKey/action' permission. This is included in built-in roles like Storage Blob Data Contributor, Storage Blob Data Owner, and Storage Blob Delegator. Additionally, the principal needs read/write access to the container or blob depending on the SAS permissions.

Can I use a stored access policy with a User Delegation SAS?

No. Stored access policies are not supported with User Delegation SAS. The User Delegation SAS already provides fine-grained control via the token itself, and revocation is not possible (except by expiry). If you need revocable access without exposing the account key, consider using Azure AD RBAC directly instead of SAS.

What is the format of a SAS token URL?

A SAS token is appended to the storage resource URL as a query string. Example for a blob: `https://myaccount.blob.core.windows.net/mycontainer/myblob.txt?sv=2021-04-10&se=2025-12-31T23:59:59Z&sr=b&sp=r&sig=<signature>`. The parameters include 'sv' (service version), 'se' (expiry), 'sr' (resource type), 'sp' (permissions), and 'sig' (signature). For Account SAS, the URL points to the account root: `https://myaccount.blob.core.windows.net/?sv=...`.

Terms Worth Knowing

Ready to put this to the test?

You've just covered SAS Token Types: Account, Service, User Delegation — now see how well it sticks with free AZ-104 practice questions. Full explanations included, no account needed.

Done with this chapter?