Compare
Storage Account Key vs SAS vs Microsoft Entra ID
30-second answer
An account key is the master key to all data in the account. A SAS grants limited permissions on limited resources until an expiry time. Microsoft Entra ID authorizes users and managed identities with RBAC data roles, with no secret to leak, and is the option Microsoft recommends.
Simulate it »Side by side
↔ Swipe the table to see every column.
| Account key | SAS token | Microsoft Entra ID | |
|---|---|---|---|
| Scope | Everything in the account | Chosen services, containers or blobs | What the RBAC data role allows, at its scope |
| Expiry | Never (rotate it yourself) | Required, set in the token or a stored access policy | Token refreshed automatically |
| Revoke | Regenerate the key | Delete the stored access policy, or regenerate the signing key | Remove the role assignment |
| Works when key access is disabled | No | Only a user delegation SAS | Yes |
| Typical use | Legacy apps, admin mounts of file shares | Short-lived access for partners and clients | Apps with managed identities, staff with roles |
Prices are illustrative pay-as-you-go list prices converted at approximate rates, for "price feel" only. Check the Azure pricing calculator for real quotes.
Which one should I pick?
Account key
Pick it when nothing else is supported, and only if the key lives in Key Vault and is rotated
SAS token
Pick it when someone outside your tenant needs time-limited access to specific data
Microsoft Entra ID
Pick it when the caller is your own app, user or managed identity
Simulate it
🖱️ Drag to rotate · scroll or pinch to zoom
Three ways in, plus one for file shares
Callers prove who they are with an account key (full control), a SAS (limited rights for limited time) or a Microsoft Entra ID token checked against RBAC data roles. For SMB file shares, users bring a Kerberos ticket from AD DS, Microsoft Entra Domain Services or Microsoft Entra Kerberos.
🤔 What happens if…
Read this tour as text
- The front door: the storage firewall. Every account has a public endpoint that accepts all networks by default. Set the default action to Deny and only what you list gets in: virtual network rules (subnets with the Microsoft.Storage service endpoint), IP rules (public addresses only) and trusted Azure services if you tick the exception.
- Three ways in, plus one for file shares. Callers prove who they are with an account key (full control), a SAS (limited rights for limited time) or a Microsoft Entra ID token checked against RBAC data roles. For SMB file shares, users bring a Kerberos ticket from AD DS, Microsoft Entra Domain Services or Microsoft Entra Kerberos.
- SAS tokens and stored access policies. A service SAS can point at a stored access policy on the container (up to 5 per container). The policy holds the permissions and expiry, so deleting or editing it revokes every SAS that names it. An ad hoc SAS can only be revoked by regenerating the key that signed it.
- Rotate access keys. Each account has two keys so you can rotate without downtime: move apps to key2, regenerate key1, and next time do the reverse. A key expiration policy flags old keys. Regenerating a key kills every SAS signed with it.
- Encryption at rest. Azure Storage always encrypts data with AES-256. By default Microsoft manages the key. With a customer-managed key in Key Vault (soft delete and purge protection on), the account’s managed identity wraps and unwraps its data key with your key, and you can revoke it.
- Redundancy and a region outage. LRS keeps 3 copies in one datacenter, ZRS spreads 3 across availability zones, GRS adds an async copy in the paired region and GZRS combines both. RA- versions let you read the secondary. A customer-managed failover promotes the secondary when the primary region is down.
- Moving data: AzCopy and object replication. AzCopy moves files in parallel from the command line, signed in with Microsoft Entra ID (and a Storage Blob Data role) or with a SAS. Storage Explorer does the same with a GUI. Object replication keeps copying new block blobs to another account by itself.
- Access tiers and lifecycle management. Blobs sit in Hot, Cool (30-day minimum), Cold (90 days) or Archive (180 days, offline). A lifecycle management rule moves or deletes blobs by age or last access, about once a day. Reading an archived blob means rehydrating it first.
- Undo buttons: soft delete, versioning and snapshots. Blob soft delete and container soft delete keep deleted items for 1 to 365 days. Versioning keeps every previous version of a blob. For Azure Files, share snapshots are read-only point-in-time copies and share soft delete keeps a deleted share.
Questions people ask
Can I disable the account keys?
Yes. Set Allow storage account key access to Disabled. Account keys, account SAS and service SAS stop working; Entra ID and user delegation SAS keep working.
Is a SAS safer than a key?
Yes, because it is scoped and expires, but anyone holding it can use it. Keep expiry short and require HTTPS.
Learn each one properly
More comparisons
- Owner vs Contributor vs Reader vs User Access Administrator
- Azure RBAC Roles vs Microsoft Entra Roles
- Blob Soft Delete vs Versioning vs Snapshots
- ARM JSON Templates vs Bicep Files
- Availability Set vs Availability Zones vs Flexible Scale Set
- Container Instances vs Container Apps vs App Service
- App Service scale up vs scale out
- Service Endpoint vs Private Endpoint
- NSG vs ASG vs Route Table
- Recovery Services Vault vs Backup Vault
- Azure Backup vs Azure Site Recovery