Secure and Share Storage: Access Keys, Shared Access Signatures, Entra ID Access, Firewalls, Private Endpoints and Encryption

Microsoft Certified Azure Administrator Associate AZ 103 60 min min read Updated: Nov 17, 2026 Intermediate
Secure and Share Storage: Access Keys, Shared Access Signatures, Entra ID Access, Firewalls, Private Endpoints and Encryption
Intermediate Topic 2 of 3

Ways to Authorize

MethodNotes
Microsoft Entra ID + RBACBest. Roles like Storage Blob Data Contributor. Works with managed identities
Shared access signature (SAS)Limited, time-bound URL
Account keysFull control. Treat like a root password. Rotate regularly
Anonymous accessPublic containers. Disable unless truly needed

Account Keys

bash az storage account keys list -g rg-demo -n stdemo482 -o table az storage account keys renew -g rg-demo -n stdemo482 --key key2 # rotate: switch apps to key1, renew key2, then swap
  • Two keys allow rotation without downtime
  • Store keys in Key Vault. Prefer Entra ID auth and disable shared key access when possible

Shared Access Signatures

TypeSigned withNotes
User delegation SASEntra ID credentialsBlob only, most secure
Service SASAccount keyOne service (blob, file, queue, table)
Account SASAccount keyMany services
bash # Read-only link to one blob valid for 2 hours az storage blob generate-sas --account-name stdemo482 -c images -n logo.png --permissions r \ --expiry $(date -u -d "+2 hours" +%Y-%m-%dT%H:%MZ) --https-only --auth-mode login --as-user --full-uri
  • Set start and expiry, permissions (r, w, d, l), HTTPS only and optional IP range
  • A stored access policy on a container lets you revoke a service SAS by changing the policy

Entra ID Access to Data

bash az role assignment create --assignee asha@contoso.com --role "Storage Blob Data Contributor" \ --scope $(az storage account show -n stdemo482 -g rg-demo --query id -o tsv)

Firewalls and Private Endpoints

bash az storage account update -n stdemo482 -g rg-demo --default-action Deny az storage account network-rule add -g rg-demo --account-name stdemo482 --vnet-name vnet-app --subnet web az storage account network-rule add -g rg-demo --account-name stdemo482 --ip-address 203.0.113.10
  • Selected networks allows listed VNet subnets (service endpoint needed) and IP ranges
  • Private endpoint gives the account a private IP in your VNet. Create the privatelink.blob.core.windows.net private DNS zone and link it to the VNet
  • Then disable public network access

Encryption

  • At rest: always on (AES-256). Keys can be Microsoft-managed or customer-managed in Key Vault
  • In transit: require HTTPS and set minimum TLS 1.2
  • Infrastructure encryption adds a second layer

Monitoring

  • Turn on diagnostic settings to send storage logs to Log Analytics
  • Use Microsoft Defender for Storage for threat alerts

Practice

  1. Create a user delegation SAS valid for one hour and test the link
  2. Rotate a storage key safely
  3. Restrict an account to one VNet subnet
  4. Assign a data role to a user and read a blob with --auth-mode login

Conclusion

Prefer Entra ID access, use short user delegation SAS tokens, guard keys, restrict networks with firewalls or private endpoints and keep encryption and logging on.

Quick Summary: authorization; keys; SAS; Entra; firewalls; encryption; monitoring.

Get Newsletter

Subscibe to our newsletter and we will notify you about the newest updates on Edugators