Encryption and Data Security in Azure: Disk Encryption, Storage and SQL Encryption, Customer-Managed Keys and Secure Transfer
Encryption States
| State | Meaning | Azure examples |
|---|---|---|
| At rest | Data stored on disk | Storage, managed disks, SQL TDE, Cosmos DB |
| In transit | Data moving on the network | HTTPS/TLS, SMB 3 encryption, VPN |
| In use | Data being processed | Confidential computing |
Azure encrypts most data at rest by default using platform-managed keys (PMK) with no work. You can move to customer-managed keys (CMK) for control.
Key Choices
| Option | You control | Notes |
|---|---|---|
| Platform-managed | Nothing | Default, easiest |
| Customer-managed (Key Vault) | Key rotation, access, revoke | Needs soft delete and purge protection |
| Managed HSM | Dedicated HSM | Strict compliance |
Disk Encryption
bash
az keyvault key create --vault-name kv-demo-482 -n disk-key --kty RSA --size 3072
az disk-encryption-set create -g rg-sec -n des-prod -l centralindia --key-url $(az keyvault key show --vault-name kv-demo-482 -n disk-key --query key.kid -o tsv) \
--source-vault kv-demo-482 --identity-type SystemAssigned
# give the set's identity "Key Vault Crypto Service Encryption User", then use it for new disks and VMs
az vm create -g rg-vm -n secure01 --image Ubuntu2204 --encryption-at-host true --os-disk-encryption-set des-prod --admin-username azureuser --generate-ssh-keys
| Disk option | Notes |
|---|---|
| Server-side encryption | Default. PMK or CMK |
| Encryption at host | Also encrypts temp disk and caches end to end |
| Azure Disk Encryption | BitLocker or dm-crypt in the guest OS using Key Vault |
| Confidential disk encryption | For confidential VMs |
Storage and Databases
bash
# Require secure transfer and TLS 1.2 on storage
az storage account update -n stdemo482 -g rg-demo --https-only true --min-tls-version TLS1_2
# Azure SQL: TDE is on by default. Check it
az sql db tde show -g rg-data -s sql-demo-482 -d shopdb
- TDE encrypts SQL data files. Optionally use a CMK (TDE protector in Key Vault)
- Always Encrypted keeps sensitive columns encrypted so even admins cannot see them in the server
- Dynamic data masking and row-level security reduce exposure
In Transit
- Use HTTPS only on App Service, Storage and Application Gateway
- Disable old TLS versions (1.0 and 1.1)
- Use VPN or ExpressRoute with encryption for hybrid links
- Use SMB 3 encryption for Azure Files
Key Rotation
- Set a rotation policy on keys and use versionless URIs so services update to the new version
- Never delete a key that still protects data. Without it the data is unrecoverable
Practice
- Create a disk encryption set with a customer-managed key
- Create a VM with encryption at host
- Turn on HTTPS only and TLS 1.2 on a storage account
- Check TDE status for an Azure SQL database
Conclusion
Azure encrypts data at rest by default. Use customer-managed keys when you need control, encrypt disks at host, require HTTPS and TLS 1.2, and protect keys with soft delete and purge protection.
Quick Summary: states; key choices; disks; storage and SQL; transit; rotation.

