Storage Access control template-specs-upgraded

SAS token

A SAS token is a signed piece of text that you append to an Azure Storage URL so a client can access data for a limited purpose. It is often used when an application wants a browser, partner system, migration tool, or background job to talk directly to Blob, File, Queue, or Table storage. Treat it like a temporary password embedded in a URL. Whoever has the token can use the allowed operations until expiry, unless the underlying key or stored policy is revoked.

Aliases
shared access signature, storage SAS, SAS URI, user delegation SAS, service SAS token
Difficulty
fundamentals
CLI mappings
4
Last verified
2026-05-22

Microsoft Learn

Microsoft Learn describes a SAS token as a client-generated string appended to an Azure Storage resource URI. Its query parameters specify resource scope, permissions, expiry, and signature. Azure Storage does not track generated tokens, so protection, distribution, and revocation planning are essential.

Microsoft Learn: Grant limited access to Azure Storage resources using shared access signatures (SAS)2026-05-22

Technical context

Technically, a SAS token is a data-plane authorization artifact made of query parameters such as version, resource scope, permissions, expiry, protocol, IP range, and signature. It can be a user delegation SAS signed through Microsoft Entra derived credentials, a service SAS for one storage service, or an account SAS covering broader services and resource types. Azure Storage validates the signature and parameters on each request but does not keep a server-side inventory of every generated token. That makes issuance control and logging especially important.

Why it matters

SAS tokens matter because they let applications avoid proxying every file through their own servers while still limiting storage access. A well-designed token can allow one user to upload a blob, let a partner download one export, or authorize a cross-account copy. A poorly designed token becomes a secret that is copied into chat, logs, browser history, or build output. Because Azure Storage does not track token creation, teams need disciplined generation, short expiry, least-privilege permissions, secure distribution, and revocation paths. SAS tokens are powerful precisely because they are convenient. That convenience requires governance because every token is portable by design.

Where you see it

Signals, screens, and Azure surfaces where this term usually becomes operational.

Signal 01

In a generated storage URL, the SAS token appears after the question mark with parameters such as sv, sr, sp, se, spr, and sig. clearly

Signal 02

In Azure CLI output, generate-sas commands print a token string that should be captured securely and never pasted into shared logs or tickets. by engineers

Signal 03

In application configuration or pipeline variables, full SAS URLs may appear as secrets used for deployment packages, exports, imports, or temporary storage access. during deployments

Signal 04

In storage diagnostic logs, requests authorized by SAS can be separated from account-key, OAuth, or anonymous access during incident investigation. by authentication method by reviewers during access reviews during audits

When this becomes relevant

Specific situations where this term helps solve real Azure design, operations, migration, security, reliability, cost, or governance problems.

  • Let a browser upload a large file directly to Blob Storage after the application authenticates the user and issues a narrow temporary token.
  • Share a time-boxed export with an external partner without creating an Azure account or exposing storage account keys.
  • Authorize a cross-account copy operation where the source object must be readable by the destination workflow for a limited window.
  • Migrate from account-key distribution to user delegation SAS so token issuance depends on Microsoft Entra permissions instead of shared keys.
  • Revoke a compromised token pattern by rotating the signing key or changing a stored access policy, then proving old URLs fail.

Real-world case studies

Different enterprise-style examples that show the term being used to hit measurable objectives.

Case study 01

Video learning platform removes upload bottleneck from its API tier

Scenario, objectives, solution, measured impact, and takeaway.

Scenario

A video learning platform accepted instructor uploads through its web API. Large videos saturated application workers, and support teams saw stalled sessions during course-launch weeks.

Business/Technical Objectives
  • Move large uploads directly to Blob Storage.
  • Keep instructors limited to their own upload path.
  • Reduce App Service scale pressure during launch weeks.
  • Avoid exposing storage account keys to the web app.
Solution Using SAS token

The platform introduced a token broker inside the authenticated instructor portal. After checking course ownership, the broker generated a user delegation SAS token for a single blob name with create and write permissions, HTTPS required, and a short expiry. The browser uploaded directly to Blob Storage, then called the API with the blob identifier for processing. Azure CLI was used in staging to generate equivalent tokens, test denied list and read operations, and verify storage account settings. The broker logged token profile, course ID, and expiry but never stored the full signature.

Results & Business Impact
  • API bandwidth dropped 68 percent during launch weeks.
  • Successful uploads for files above two gigabytes improved from 82 percent to 97 percent.
  • App Service scale-out events fell from nine per week to two.
  • No account keys were present in application settings after rollout.
Key Takeaway for Glossary Readers

A SAS token can remove the application from the file-transfer path while keeping storage access narrow and temporary.

Case study 02

Genomics lab shares sequencing exports without creating external identities

Scenario, objectives, solution, measured impact, and takeaway.

Scenario

A genomics lab needed to share large sequencing result files with grant collaborators for a short review period. Creating guest identities for every collaborator slowed the review process and increased administration.

Business/Technical Objectives
  • Share read-only data exports for limited windows.
  • Avoid permanent external accounts for temporary reviewers.
  • Prove that old export links no longer worked.
  • Keep download traffic out of the analysis portal.
Solution Using SAS token

The research platform generated read-only SAS tokens for export blobs after an internal reviewer approved the sharing request. Tokens used HTTPS-only access, short expiry, and resource scope limited to the specific export file. The portal sent links through an approved notification channel and displayed the expiry time clearly. Azure CLI generated sample tokens during validation and tested access after expiry. Storage diagnostic logs were routed to Log Analytics so operators could distinguish collaborator downloads from internal pipeline reads. When one link was accidentally forwarded, the team rotated the relevant signing key and reissued approved exports.

Results & Business Impact
  • Reviewer onboarding time dropped from three days to under one hour.
  • Portal CPU during download windows fell 44 percent.
  • Expired export links failed in every quarterly access test.
  • The accidental forward was contained before any unapproved download completed.
Key Takeaway for Glossary Readers

SAS tokens are useful for temporary external sharing when the team treats each link as a scoped secret with a planned end date.

Case study 03

Financial operations team secures month-end statement delivery

Scenario, objectives, solution, measured impact, and takeaway.

Scenario

A financial operations team generated month-end customer statements in Azure Storage and exposed them through the customer portal. The old design routed every download through the API and timed out under high concurrency.

Business/Technical Objectives
  • Improve statement download reliability during the first two days of each month.
  • Limit every customer token to one statement object.
  • Prevent full SAS URLs from entering logs.
  • Create a rapid revocation path for issued links.
Solution Using SAS token

The application changed to issue one-time SAS URLs after the customer completed multifactor authentication. Each token granted read permission to one statement blob, expired in ten minutes, and required HTTPS. The broker stored only a token profile ID and statement ID, while observability filters removed sig values from traces. Azure CLI tests verified that a token for one customer could not list the container or download another blob. The storage team also prepared a key-rotation runbook for account-key-signed fallback tokens, although normal issuance used user delegation SAS.

Results & Business Impact
  • Download timeout tickets fell by 73 percent during the next close cycle.
  • API egress dropped 59 percent because clients downloaded from Blob Storage directly.
  • Log scans found zero full SAS signatures after sanitization.
  • Revocation drill time improved from 50 minutes to 12 minutes.
Key Takeaway for Glossary Readers

A SAS token can improve customer-facing performance only if secrecy, expiry, and revocation are engineered into the delivery path.

Why use Azure CLI for this?

I use Azure CLI for SAS tokens because it makes issuance deliberate and auditable during engineering work. CLI can generate a user delegation SAS with --auth-mode login and --as-user, show the storage account settings that affect Shared Key, and test a token immediately against blob operations. It also helps during incidents: I can stop using a leaked token pattern, rotate keys when required, or prove that a new token has the right permissions and expiry. The portal is fine for occasional learning, but production token patterns belong in reviewed scripts and broker code. It also keeps secret handling visible in code reviews and pipelines.

CLI use cases

  • Generate a user delegation SAS for a blob or container and test the exact read, write, or copy workflow from a shell.
  • Show storage account settings that influence SAS risk, including Shared Key access, network rules, and key rotation state.
  • Create short-lived tokens for deployment, export, or migration automation without placing account keys directly in scripts.

Before you run CLI

  • Confirm tenant, subscription, storage account, container or file share, resource scope, auth mode, permissions, expiry, protocol, and output handling.
  • Decide whether the token should be user delegation, service SAS, or account SAS; the wrong type can expand blast radius.
  • Treat generated output as secret material, review cost and destructive risks, and avoid shell history or pipeline logs that reveal sig.

What output tells you

  • The SAS token output shows non-secret parameters for scope, permissions, expiry, protocol, and signature; the signature itself must be protected.
  • Storage operation output confirms whether the token can perform the intended action, such as upload, download, list, or copy.
  • Account output reveals whether Shared Key access, network rules, and account configuration support the intended token security model.

Mapped Azure CLI commands

SAS token generation and validation

operational
az storage blob generate-sas --account-name <storage-account> --container-name <container> --name <blob> --permissions r --expiry <utc-expiry> --auth-mode login --as-user --https-only
az storage blobsecureStorage
az storage container generate-sas --account-name <storage-account> --name <container> --permissions cw --expiry <utc-expiry> --auth-mode login --as-user --https-only
az storage containersecureStorage
az storage account show --name <storage-account> --resource-group <resource-group> --query "{allowSharedKeyAccess:allowSharedKeyAccess,networkRuleSet:networkRuleSet}"
az storage accountdiscoverStorage
az storage blob download --account-name <storage-account> --container-name <container> --name <blob> --file <path> --sas-token <sas-token>
az storage bloboperateStorage

Architecture context

Architecturally, a SAS token is best produced by a trusted broker, not scattered through notebooks and pipeline variables. The broker authenticates the user or workload, decides what operation is allowed, creates a narrow token, and returns it only over HTTPS. The application avoids becoming a file-transfer bottleneck, while storage handles the heavy data path. The architecture must also decide where tokens are never stored, how expiry is refreshed, how logs are sanitized, and how compromise is revoked. For blob workloads, using Microsoft Entra based user delegation SAS reduces dependence on account keys and fits zero-trust designs better. That boundary is deliberate.

Security

Security impact is direct and high. A SAS token is a bearer secret, so possession is enough to use it within its constraints. If it leaks through logs, URLs, referrers, screenshots, or shell history, an attacker can access storage until expiry or revocation. Secure designs use HTTPS, short expiry, least-privilege permissions, optional IP restrictions, user delegation SAS where possible, and limited ability to generate account-key SAS tokens. Teams should avoid storing full SAS URLs, sanitize telemetry, rotate account keys when account-key tokens are compromised, and consider disabling Shared Key authorization for supported workloads. Incident drills should prove old URLs fail after the chosen revocation action.

Cost

SAS tokens affect cost indirectly through data movement and application architecture. Direct-to-storage uploads can reduce app-server CPU, memory, bandwidth, and scaling costs because the application no longer handles large file streams. Leaked or overbroad tokens can drive unplanned egress, extra transactions, duplicate exports, or malicious writes that increase storage bills. Failed token renewal can also trigger reruns of large transfers. FinOps owners should review token use for public downloads, partner exports, migration jobs, and temporary automation. A cheap SAS design is narrow, short-lived, monitored, and aligned with lifecycle rules. Those reviews keep temporary convenience from becoming recurring unowned consumption.

Reliability

Reliability impact is direct because SAS token problems often appear as broken uploads, failed downloads, or 403 errors from otherwise healthy storage accounts. Expired tokens, clock skew, missing permissions, wrong resource scope, revoked keys, or network restrictions can all break clients. Reliable designs centralize token generation, return clear expiry information, renew before deadlines, and test tokens against the exact operation path. They also avoid long-lived tokens as a reliability shortcut because those become security debt. Runbooks should help operators distinguish token failure from service availability, firewall denial, and application defects. Clients should receive renewal guidance before users experience abrupt authorization failure.

Performance

Performance impact is direct for file-heavy workflows. SAS tokens let clients and services communicate directly with Azure Storage, avoiding a web application proxy that would otherwise become a throughput bottleneck. That improves upload concurrency, download speed, and large-object copy behavior. Token design still affects performance: expired or under-permissioned tokens cause retries, and IP restrictions can fail mobile clients moving networks. The token broker should be fast, cache only safe metadata, and issue tokens close to the requested operation time. Performance testing should include token generation latency, storage throughput, retry rate, and client renewal behavior. Load tests should include both token issuance and direct storage transfer.

Operations

Operators manage SAS tokens through generation scripts, token broker logs, storage diagnostic logs, key rotation records, and policy checks. Since Azure Storage does not list every generated SAS token, operations teams focus on controlling who can generate them and observing how they are used. They review permissions, expiry, protocol, IP range, auth mode, and storage account settings. During troubleshooting, they decode the non-secret parts of the query string, test with a fresh token, and avoid pasting signatures into tickets. Mature teams maintain approved token profiles for upload, download, copy, and temporary support access. Approved profiles should be versioned so support can identify behavior without seeing secrets.

Common mistakes

  • Saving full SAS URLs in application logs, telemetry, or ticket comments where the signature can be copied and reused.
  • Using account-key SAS for every workflow even when user delegation SAS would satisfy the requirement with less key exposure.
  • Assuming Azure can list and revoke every SAS token individually, then discovering revocation depends on keys or stored policies.