Azure Storage Security and Access: Entra ID, SAS Tokens, Firewalls, Private Endpoints, Encryption and Azure Files
Ways to Authorize Access
| Method | Notes | Advice |
|---|---|---|
| Microsoft Entra ID + RBAC | Roles like Storage Blob Data Reader. Supports managed identities and conditional access | Best choice |
| User delegation SAS | A signed URL created with Entra credentials | Best for temporary sharing |
| Service SAS / Account SAS | Signed with the account key | Use short expiry and stored access policies |
| Shared Key (account keys) | Full control for anyone with the key | Disable if possible (--allow-shared-key-access false) and rotate keys |
| Anonymous public read | Public containers | Avoid. Disable at account level |
bash
# Disable shared key and public access, force Entra ID
az storage account update -n stshopprod482 -g rg-data --allow-shared-key-access false --allow-blob-public-access false
az role assignment create --assignee <group-id> --role "Storage Blob Data Contributor" --scope $(az storage account show -n stshopprod482 -g rg-data --query id -o tsv)
# User delegation SAS: a link that works 1 hour for one blob
az storage blob generate-sas --account-name stshopprod482 -c reports -n 2026/report.pdf --permissions r \
--expiry $(date -u -d "+1 hour" +%Y-%m-%dT%H:%MZ) --auth-mode login --as-user --full-uri
SAS Best Practices
- Use HTTPS only, minimum permissions, short expiry
- Prefer user delegation SAS over account-key SAS
- Use stored access policies to revoke service SAS tokens
- Treat a SAS like a password: do not post it publicly
Network Protection
| Control | How it works |
|---|---|
| Storage firewall | Allow only chosen VNets/subnets (service endpoints), IP ranges or trusted Azure services. Default action Deny |
| Private endpoint | A private IP for the storage account in your VNet. Add the privatelink DNS zone, then disable public network access |
| Resource instance rules | Allow specific Azure resources such as a Synapse workspace |
| Secure transfer required | HTTPS only. Set minimum TLS 1.2 |
bash
az network private-endpoint create -g rg-data -n pe-st-blob --vnet-name vnet-app --subnet data \
--private-connection-resource-id $(az storage account show -n stshopprod482 -g rg-data --query id -o tsv) --group-id blob --connection-name pe-conn
az network private-dns zone create -g rg-data -n privatelink.blob.core.windows.net
az network private-dns link vnet create -g rg-data -n link-app --zone-name privatelink.blob.core.windows.net --virtual-network vnet-app --registration-enabled false
az storage account update -n stshopprod482 -g rg-data --public-network-access Disabled
Encryption
- At rest: always encrypted with AES-256. Keys are Microsoft-managed by default or customer-managed (CMK) in Key Vault or Managed HSM
- Infrastructure encryption adds a second layer
- In transit: TLS. Azure Files SMB 3 supports encryption in transit
Azure Files
| Feature | Description |
|---|---|
| SMB shares | Windows, Linux and macOS clients. Mount from Azure or on-premises (port 445 must be open) |
| NFS shares | Linux workloads (Premium) |
| Identity-based access | Entra Kerberos, AD DS or Entra Domain Services for NTFS-style permissions |
| Tiers | Premium (SSD), Transaction optimized, Hot, Cool |
| Snapshots and backup | Share snapshots and Azure Backup |
| Azure File Sync | Cache a cloud share on Windows Servers on-premises with cloud tiering of cold files |
bash
az storage share-rm create -g rg-data --storage-account stshopprod482 -n teamshare --quota 1024 --access-tier TransactionOptimized
# Linux mount
sudo mount -t cifs //stshopprod482.file.core.windows.net/teamshare /mnt/team -o username=stshopprod482,password=<key>,serverino,vers=3.0
Monitoring and Compliance
- Turn on diagnostic settings to Log Analytics for read, write and delete logs
- Use Microsoft Defender for Storage to detect malware uploads and unusual access
- Use Azure Policy to require private endpoints, HTTPS and no public access
Practice
- Disable shared key access and use an Entra role instead
- Create a user delegation SAS valid for one hour
- Add a private endpoint, private DNS zone and disable public access
- Create an Azure Files share and mount it on a VM
Conclusion
Secure storage with Entra ID and RBAC, short-lived user delegation SAS, disabled shared keys and public access, firewalls and private endpoints, and customer-managed keys when needed. Azure Files gives SMB and NFS shares with File Sync for hybrid use.
Quick Summary: authorization; SAS; network; encryption; Azure Files; monitoring.

