Your profile

One profile for every MSDEVBUILD site. Only you can see it, and the site owner if you write in.

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 keySAS tokenMicrosoft Entra ID
ScopeEverything in the accountChosen services, containers or blobsWhat the RBAC data role allows, at its scope
ExpiryNever (rotate it yourself)Required, set in the token or a stored access policyToken refreshed automatically
RevokeRegenerate the keyDelete the stored access policy, or regenerate the signing keyRemove the role assignment
Works when key access is disabledNoOnly a user delegation SASYes
Typical useLegacy apps, admin mounts of file sharesShort-lived access for partners and clientsApps 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

3D Azure Storage for administrators: access, protection and data movement Send a key, a SAS and a token at the account.

🖱️ Drag to rotate · scroll or pinch to zoom

Loading the 3D scene…
</> Embed

Embed this simulation

Free for trainers, teachers and bloggers. Paste this into your page:

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.

Read this tour as text
  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. 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.
  8. 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.
  9. 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

Install MSDEVBUILD Azure

Free · no account · works offline

Save the whole course for offline ›

Hi, I’m your Nimbus

Your study buddy. Pick what we do next.

MSDEVBUILD · Multi-Stack Dev Build

Sign in to MSDEVBUILD

One account for Azure certifications and the blog: sign in here and you are signed in on both. Your XP, streak, practice deck and certificate stay in sync on every device. Optional: everything works without an account.