Storage Storage accounts complete field-manual-complete

Storage account SAS

A storage account SAS is a temporary access token attached to a storage URL. It can grant permissions across storage services, such as Blob, File, Queue, and Table, depending on how it is signed and scoped. A SAS is useful when an external tool, partner, or short-lived process needs access without getting a full account key or identity assignment. The risky part is that anyone with the URL can use it until it expires or is blocked. Treat it like a password with a built-in scope and clock.

Aliases
account SAS, storage SAS token, storage account shared access signature, account shared access signature
Difficulty
fundamentals
CLI mappings
5
Last verified
2026-05-25

Microsoft Learn

A storage account SAS is a signed URI query string that grants limited access to services, resource types, permissions, and time ranges in a storage account. It is useful for controlled delegation, but it must be scoped, time-bounded, protected, and audited like a credential.

Microsoft Learn: Grant limited access to Azure Storage resources using shared access signatures2026-05-25

Technical context

Technically, an account SAS is generated from storage account credentials and includes signed parameters for services, resource types, permissions, start time, expiry, protocol, IP range, and signature. It operates at the storage data plane and can authorize requests without Microsoft Entra authentication. Account SAS differs from service SAS, user delegation SAS, and stored access policies. Teams use it for controlled delegation, but governance often pushes toward managed identities or user delegation SAS for Blob workloads. Operators inspect allowSharedKeyAccess, key rotation, expiry patterns, and logs when assessing SAS risk.

Why it matters

Storage account SAS matters because it is powerful, portable, and easy to misuse. It can solve real integration problems when a partner or batch process needs limited storage access, but it can also become an untracked credential pasted into tickets, scripts, or browser histories. Overbroad permissions, long expirations, missing IP restrictions, and shared key dependency are common failure modes. For architects, SAS is a delegation pattern that must be compared with managed identity, RBAC, and user delegation SAS. For operators, the main job is constraining blast radius, rotating account keys when needed, and building evidence around who issued what access.

Where you see it

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

Signal 01

In generated storage URLs, the SAS appears as query-string parameters such as sv, ss, srt, sp, se, spr, sig, and optional IP restrictions in client requests.

Signal 02

In CLI commands, account SAS generation requires explicit services, resource types, permissions, expiry, and optional protocol or IP range settings before secure token distribution reviews.

Signal 03

In storage diagnostic logs, requests may show SAS-based authentication patterns that help operators investigate token misuse, expiry failures, or unexpected data access during incident investigations.

When this becomes relevant

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

  • Give a partner short-lived upload access to one storage account without sharing account keys or creating an identity.
  • Let a batch export job write directly to Blob storage for a controlled time window and permission set.
  • Replace long-lived shared scripts with pipeline-generated SAS tokens that expire after each deployment or transfer.
  • Restrict temporary access by IP range and HTTPS-only protocol for a known external integration.
  • Investigate whether failed uploads came from SAS expiry, missing permissions, wrong service scope, or network denial.

Real-world case studies

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

Case study 01

Events company replaces long-lived upload links

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

Scenario

A live events company let venue contractors upload floor-plan files with year-long SAS URLs. One URL was forwarded to an outside vendor and allowed unnecessary write access for months.

Business/Technical Objectives
  • Replace long-lived upload SAS links with short-lived, event-specific tokens.
  • Limit contractor access to HTTPS and known venue IP ranges where possible.
  • Prevent full SAS values from appearing in support tickets and email threads.
  • Maintain simple uploads for contractors without giving them Azure accounts.
Solution Using Storage account SAS

The operations team moved SAS generation into a deployment pipeline that required event ID, expiry, permissions, and optional IP range. The generated account SAS granted only create and write access for the needed storage service and expired after each event setup window. Support documentation showed masked token parameters, not full signatures. For larger venues, the team added IP restrictions and monitored diagnostic logs for unexpected access after expiry. Account keys were rotated after the old year-long tokens were retired.

Results & Business Impact
  • Average SAS lifetime dropped from 365 days to 18 hours.
  • Unauthorized upload attempts after event close fell by 94 percent.
  • Support ticket leakage of full SAS URLs stopped after masking became mandatory.
  • Contractor upload success stayed above 98 percent because the workflow remained URL-based.
Key Takeaway for Glossary Readers

A SAS can be convenient and safe only when scope, expiry, handling, and revocation are designed together.

Case study 02

Nonprofit data exchange narrows partner access

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

Scenario

A nonprofit shared grant application exports with regional partners. Partners needed direct download access, but previous scripts generated broad SAS tokens with list and delete permissions.

Business/Technical Objectives
  • Give partners read-only access to approved export data.
  • Remove delete, write, and list permissions from routine sharing workflows.
  • Document who requested each token and when it expired.
  • Reduce manual storage key exposure by help-desk staff.
Solution Using Storage account SAS

The engineering lead replaced ad hoc portal-generated tokens with a CLI script that accepted partner name, export container, expiry, and IP range. The script generated a narrow SAS, stored request metadata without the signature, and sent the link through the nonprofit’s secure messaging tool. Help-desk staff no longer listed account keys. Monthly review compared issued token metadata with storage logs to confirm downloads came from expected ranges. For internal analysts, the team moved to managed identity and RBAC instead of SAS.

Results & Business Impact
  • Routine partner tokens lost delete and write permissions across 100 percent of export workflows.
  • Help-desk access to storage account keys was removed for 14 staff members.
  • Partner download failures caused by missing permissions fell from 11 per month to two.
  • Monthly access review time dropped from six hours to ninety minutes.
Key Takeaway for Glossary Readers

SAS governance is stronger when token issuance records the business purpose but never stores the secret itself.

Case study 03

Robotics lab contains leaked test token

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

Scenario

A robotics lab used a SAS token in a test harness that uploaded camera snapshots. The token appeared in a public build log with write and delete permissions on the account.

Business/Technical Objectives
  • Contain the leaked token before production datasets were affected.
  • Identify every script that depended on account-key-signed SAS.
  • Move internal test harnesses toward managed identity where feasible.
  • Create a safer pattern for future temporary external data drops.
Solution Using Storage account SAS

The incident commander treated the SAS as a leaked credential. The team rotated the storage account key that signed the token, reviewed diagnostic logs for unexpected write and delete operations, and disabled public network access on nonessential test accounts. CLI searches found several scripts generating account SAS without expiry standards. Internal robotics test jobs moved to managed identities with RBAC. For external data drops, the lab kept SAS but required short expiry, HTTPS-only access, masked logging, and a documented revocation path.

Results & Business Impact
  • The leaked token was invalidated within 27 minutes of detection.
  • No production datasets showed unauthorized writes after log and metric review.
  • Eight internal scripts moved from SAS to managed identity within one sprint.
  • Future test SAS tokens were capped at four hours with required HTTPS-only settings.
Key Takeaway for Glossary Readers

A leaked SAS should be handled like a credential incident, not like a harmless URL cleanup task.

Why use Azure CLI for this?

I use CLI for storage account SAS because SAS safety comes from exact parameters, not from intuition. CLI makes the services, resource types, permissions, protocol, IP range, start time, and expiry visible and repeatable. It also prevents teams from using a full account key interactively when a short-lived signed URL is enough. In operations, I want SAS generation scripted with safe defaults and logged in pipeline output without exposing the token value broadly. CLI is also useful for checking allowSharedKeyAccess, listing keys only when justified, and revoking delegation keys during incident response. That evidence is essential when tokens leave the team.

CLI use cases

  • Generate a short-lived account SAS with explicit services, resource types, permissions, expiry, protocol, and IP range.
  • Check whether shared key access is allowed before relying on account-key-signed SAS generation.
  • List or rotate account keys only under an approved credential response or key-rotation procedure.
  • Create evidence showing SAS parameters without storing the full signature in logs or tickets.
  • Revoke delegation keys or rotate account keys during a suspected token leak response.

Before you run CLI

  • Confirm tenant, subscription, resource group, account name, target services, resource types, permissions, expiry, protocol, and allowed IP range.
  • Verify whether shared key access is permitted; account SAS generation may depend on account keys unless another SAS type is appropriate.
  • Do not print full SAS tokens into shared logs, screenshots, tickets, shell history, or chat channels.
  • Check whether managed identity, RBAC, or user delegation SAS would be safer for the caller and workload.
  • Understand that rotating account keys or disabling shared key access can invalidate active SAS-dependent processes.

What output tells you

  • The SAS query string contains signed services, resource types, permissions, expiry, protocol, version, and signature values.
  • sp indicates permissions such as read, write, list, create, add, update, process, or delete depending on the service.
  • ss and srt show which storage services and resource types the account SAS can access.
  • se and st define the validity window; expiry failures often appear as authentication errors to clients.
  • allowSharedKeyAccess indicates whether account-key-based authorization is currently permitted for the storage account.

Mapped Azure CLI commands

Storage account SAS CLI commands

direct
az storage account generate-sas --account-name <account-name> --services bqtf --resource-types sco --permissions rwdlacup --expiry <yyyy-mm-ddThh:mmZ> --https-only
az storage accountsecureStorage
az storage account show --name <account-name> --resource-group <resource-group> --query allowSharedKeyAccess
az storage accountdiscoverStorage
az storage account keys list --account-name <account-name> --resource-group <resource-group>
az storage account keysdiscoverStorage
az storage account keys renew --account-name <account-name> --resource-group <resource-group> --key primary
az storage account keyssecureStorage
az storage account revoke-delegation-keys --name <account-name> --resource-group <resource-group>
az storage accountsecureStorage

Architecture context

Architecturally, a storage account SAS is a delegation mechanism at the storage data plane. It sits between full account-key access and identity-based access, and it is often used where the caller cannot use Microsoft Entra directly. Account SAS can cross services and resource types, so it belongs in designs that explicitly define allowed operations, expiry, network restrictions, and token handling. It should not be the default for internal Azure workloads that can use managed identity. Architects also decide whether shared key access is allowed at all, how keys rotate, how SAS issuance is audited, and how leaked tokens are contained.

Security

Security impact is direct and high. A SAS token is a bearer credential; possession is enough to use the granted permissions until the token expires or underlying keys are rotated or disabled. The safest account SAS is narrow in permissions, short in lifetime, restricted by protocol and IP range where possible, and never logged or stored casually. Long-lived write SAS tokens are especially dangerous because they can allow data deletion, overwrite, or exfiltration. Teams should prefer managed identity or user delegation SAS when appropriate, disable shared key access where feasible, rotate account keys, and monitor storage logs for unusual SAS use.

Cost

A SAS token has no standalone charge, but it can drive storage transactions, egress, write growth, and cleanup costs. An overbroad SAS used by a partner or automation job can upload unexpected data, trigger lifecycle processing, or exfiltrate data across regions. Long-lived tokens also create operational cost because teams must track, renew, and eventually revoke them. The safer cost pattern is short-lived, purpose-specific SAS issuance with monitoring on transaction volume and data transfer. FinOps and security teams should review SAS-heavy workflows because the token itself is free while the activity it enables can be expensive. Unexpected transfer volume should trigger immediate review.

Reliability

Reliability impact is indirect but common in real systems. An expired or malformed SAS can stop uploads, backups, exports, partner transfers, or ingestion jobs even when the storage account is healthy. A token scoped too narrowly can cause partial failures, while one scoped too broadly creates security risk. Rotating account keys can invalidate SAS tokens signed with those keys and break undocumented dependencies. Operators should manage expirations intentionally, publish renewal runbooks, and test clients before changing shared key access. SAS reduces dependency on identity integration for external callers, but it adds credential lifecycle risk that must be monitored. Expiration monitoring prevents avoidable support incidents.

Performance

Performance impact is mostly tied to the workload that uses the SAS. The token does not raise storage throughput, but it can enable high-volume clients to read, upload, or delete data directly against storage without an application proxy. That can improve application performance by offloading transfer work, but it also exposes account limits, concurrency behavior, and egress costs directly to the client. Poorly scoped SAS permissions can cause repeated failed requests, while short expiries can interrupt long transfers. Operators should monitor request latency, throttling, failed authorization, and client retry patterns for SAS-based workflows. This separates storage limits from token design mistakes.

Operations

Operators handle SAS by generating tokens with approved parameters, distributing them through secure channels, tracking expiry, reviewing usage, and responding to suspected leaks. Practical checks include showing account settings, confirming allowSharedKeyAccess, listing keys only with approval, and reviewing storage diagnostics for signed access patterns. Automation should avoid printing full SAS values in logs and should produce evidence of scope without exposing secrets. Incident response may involve rotating account keys, disabling shared key authorization, revoking delegation keys, or tightening public network access. Good operations treat SAS issuance as a controlled credential workflow, not a convenience shortcut. That discipline keeps temporary access from becoming permanent.

Common mistakes

  • Creating a long-lived SAS with delete or write permissions when a short-lived read token was sufficient.
  • Pasting full SAS URLs into logs, ticket comments, browser bookmarks, or shared documentation.
  • Assuming a SAS can be individually revoked without rotating keys or changing the authorization model.
  • Forgetting IP and HTTPS restrictions for external integrations that have stable network egress.
  • Using account SAS for internal Azure workloads that could have used managed identity and RBAC instead.