Lesson 4 of 5 Azure Storage Accounts

Managing Storage Account Encryption

All Azure Storage data is encrypted at rest. This lesson explains key management options and additional encryption features.

Learning outcomes

After completing this lesson, you will be able to:

  • Distinguish between Microsoft-managed and customer-managed keys.
  • Identify the requirements for customer-managed keys in Key Vault.
  • Describe infrastructure encryption, encryption scopes and customer-provided keys.

Storage Service Encryption and key management

Storage Service Encryption (SSE) encrypts all data in a storage account (blobs, files, queues, tables and metadata) with 256-bit AES, transparently and at no extra cost, and it cannot be disabled. The account's data encryption keys are protected by a key encryption key that is either a Microsoft-managed key (the default, rotated by Microsoft) or a customer-managed key stored in Azure Key Vault or Key Vault Managed HSM.

With customer-managed keys, the organization controls the key's life cycle: it can rotate the key, choose automatic updates to the latest key version, and revoke access, which makes the data unreadable. The storage account accesses the key through a managed identity (user-assigned when customer-managed keys are configured at account creation, and system-assigned or user-assigned for an existing account) that needs the Key Vault Crypto Service Encryption User role on the key, and the key vault must have soft delete and purge protection enabled. Customer-managed keys can apply to blobs and files, and optionally to queues and tables when chosen at creation.

The following diagram shows the key vault requirements for using customer-managed keys with a storage account.

Why saving customer-managed keys on the storage account fails. Customer-managed keys need purge protection on the key vault as well as soft delete, and the storage account's managed identity needs the Key Vault Crypto Service Encryption User role on the key. Revoking the key later makes the documents unreadable, as the regulator requires.
The scenario is illustrative.
Select all that apply

Requirements for customer-managed keys

Exam skills 2.2.4

Select every requirement for using a customer-managed key with an existing storage account.

Log in to try this activity Interactive activities are free with an account.

Additional encryption options

Infrastructure encryption encrypts data a second time at the infrastructure layer with a different key and algorithm, for organizations that require double encryption. It can be enabled only when the account is created. Encryption scopes let containers or individual blobs use a different key, Microsoft-managed or customer-managed, within the same account; a container can enforce its default scope for all blobs, which isolates the data of different customers. Customer-provided keys are sent by the client with each Blob Storage request and never stored by Azure.

Encryption in transit is separate: Require secure transfer rejects HTTP requests and unencrypted SMB connections, and Minimum TLS version rejects clients that use older TLS versions. The following table summarizes the options.

RequirementOption
No configuration, Microsoft manages keysMicrosoft-managed keys (default)
Control, rotate and revoke the keyCustomer-managed key in Key Vault or Managed HSM
Two layers of encryption at restInfrastructure encryption (at creation)
Different keys for different containersEncryption scopes
Client supplies the key per requestCustomer-provided keys (Blob Storage)
Match the pairs

Encryption options

Exam skills 2.2.4

Match each requirement with the encryption option that meets it.

Log in to try this activity Interactive activities are free with an account.
Worked example

Customer-managed keys

A regulator requires that a bank can make its stored documents unreadable at any time by revoking the encryption key, and that the key is rotated every year. An administrator selects a key vault and key on the storage account's Encryption page, but the save fails. The key vault has soft delete enabled and uses Azure RBAC. What is the most likely missing configuration?

Customer-managed keys require purge protection on the key vault in addition to soft delete, and the storage account's managed identity needs the Key Vault Crypto Service Encryption User role on the key. Enable purge protection and assign the role, then select the key with automatic version updates and configure a rotation policy on the key. Infrastructure encryption would add a layer but would not give the bank control over revocation.

Check yourself

When can infrastructure encryption be enabled on a storage account?

Show answer

Only when the account is created; it cannot be enabled later.

Exam Tips

Remember for the exam

  • All storage data is encrypted with 256-bit AES; encryption cannot be disabled.
  • Customer-managed keys need a managed identity, soft delete and purge protection.
  • Infrastructure encryption can be enabled only at account creation.
  • Different keys per container: encryption scopes.