Use the Azure portal to enable end-to-end encryption using encryption at host

When you enable encryption at host, data stored on the VM host is encrypted at rest and flows encrypted to the Storage service. For conceptual information on encryption at host, and other managed disk encryption types, see:

Restrictions

  • Does not support ultra disks.
  • Cannot be enabled if Azure Disk Encryption (guest-VM encryption using bitlocker/VM-Decrypt) is enabled on your VMs/virtual machine scale sets.
  • Azure Disk Encryption cannot be enabled on disks that have encryption at host enabled.
  • The encryption can be enabled on existing virtual machine scale set. However, only new VMs created after enabling the encryption are automatically encrypted.
  • Existing VMs must be deallocated and reallocated in order to be encrypted.
  • Supports ephemeral OS disks but only with platform-managed keys.

Supported VM sizes

All the latest generation of VM sizes support encryption at host:

Type Not Supported Supported
General purpose Dv3, Dv2, Av2 B, DSv2, Dsv3, DC, DCv2, Dav4, Dasv4, Ddv4, Ddsv4
Compute optimized Fsv2
Memory optimized Ev3 Esv3, M, Mv2, Eav4, Easv4, Edv4, Edsv4
Storage optimized Ls, Lsv2 (NVMe disks not encrypted)
GPU NC, NV NCv2, NCv3, ND, NVv3, NVv4, NDv2 (preview)
High performance compute H HB, HC, HBv2
Previous generations F, A, D, L, G DS, GS, Fs, NVv2

Prerequisites

You must enable the feature for your subscription before you use the EncryptionAtHost property for your VM/VMSS. Follow the steps below to enable the feature for your subscription:

  1. Azure portal: Select the Cloud Shell icon on the Azure portal:

    Icon to launch the Cloud Shell from the Azure portal

  2. Execute the following command to register the feature for your subscription

     Register-AzProviderFeature -FeatureName "EncryptionAtHost" -ProviderNamespace "Microsoft.Compute" 
    
  3. Confirm that the registration state is Registered (takes a few minutes) using the command below before trying out the feature.

     Get-AzProviderFeature -FeatureName "EncryptionAtHost" -ProviderNamespace "Microsoft.Compute"  
    

Sign in to the Azure portal using the provided link.

Important

You must use the provided link to access the Azure portal. Encryption at host is not currently visible in the public Azure portal without using the link.

Create an Azure Key Vault and disk encryption set

Once the feature is enabled, you'll need to set up an Azure Key Vault and a disk encryption set, if you haven't already.

Setting up customer-managed keys for your disks will require you to create resources in a particular order, if you're doing it for the first time. First, you will need to create and set up an Azure Key Vault.

Set up your Azure Key Vault

  1. Sign into the Azure portal.

  2. Search for and select Key Vaults.

    Screenshot of the Azure portal with the search dialog box expanded.

    Important

    Your Azure key vault, disk encryption set, VM, disks, and snapshots must all be in the same region and subscription for deployment to succeed.

  3. Select +Add to create a new Key Vault.

  4. Create a new resource group.

  5. Enter a key vault name, select a region, and select a pricing tier.

    Note

    When creating the Key Vault instance, you must enable soft delete and purge protection. Soft delete ensures that the Key Vault holds a deleted key for a given retention period (90 day default). Purge protection ensures that a deleted key cannot be permanently deleted until the retention period lapses. These settings protect you from losing data due to accidental deletion. These settings are mandatory when using a Key Vault for encrypting managed disks.

  6. Select Review + Create, verify your choices, then select Create.

    Screenshot of the Azure Key Vault creation experience. Showing the particular values you create

  7. Once your key vault finishes deploying, select it.

  8. Select Keys under Settings.

  9. Select Generate/Import.

    Screenshot of the Key Vault resource settings pane. Shows the generate/import button inside settings.

  10. Leave both Key Type set to RSA and RSA Key Size set to 2048.

  11. Fill in the remaining selections as you like and then select Create.

    Screenshot of the create a key blade that appears once generate/import button is selected

Add an Azure RBAC role

Now that you've created the Azure key vault and a key, you must add an Azure RBAC role, so you can use your Azure key vault with your disk encryption set.

  1. Select Access control (IAM) and add a role.
  2. Add either the Key Vault Administrator, Owner, or Contributor roles.

Set up your disk encryption set

  1. Search for Disk Encryption Sets and select it.

  2. On the Disk Encryption Sets blade select +Add.

    Screenshot of the disk encryption portal main screen. Highlighting the Add button

  3. Select your resource group, name your encryption set, and select the same region as your key vault.

  4. For Encryption type, select Encryption at-rest with a customer-managed key.

    Note

    Once you create a disk encryption set with a particular encryption type, it cannot be changed. If you want to use a different encryption type, you must create a new disk encryption set.

  5. Select Click to select a key.

  6. Select the key vault and key you created previously, and the version.

  7. Press Select.

  8. Select Review + Create and then Create.

    Screenshot of the disk encryption creation blade. Showing the subscription, resource group, disk encryption set name, region, and key vault + key selector.

Deploy a VM

Now that you've setup an Azure Key Vault and disk encryption set, you can deploy a VM and it will use encryption at host.

  1. Search for Virtual Machines and select + Add to create a VM.

  2. Create a new virtual machine, select an appropriate region and a supported VM size.

  3. Fill in the other values on the Basic blade as you like, then proceed to the Disks blade.

    Screenshot of the virtual machine creation basics blade, region and V M size are highlighted.

  4. On the Disks blade, select Yes for Encryption at host.

  5. Make the remaining selections as you like.

    Screenshot of the virtual machine creation disks blade, encryption at host is highlighted.

  6. Finish the VM deployment process, make selections that fit your environment.

You have now deployed a VM with encryption at host enabled, all its associated disks will be encrypted using encryption at host.

Next steps

Azure Resource Manager template samples