This article describes how to back up and restore Windows or Linux Azure virtual machines (VMs) with encrypted disks using the Azure Backup service. For more information, see Encryption of Azure VM backups.
Supported scenarios for backup and restore of encrypted Azure VMsThis section describes the supported scenarios for backup and restore of encrypted Azure VMs.
Encryption using platform-managed keysBy default, all the disks in your VMs are automatically encrypted-at-rest using platform-managed keys (PMK) that use storage service encryption. You can back up these VMs using Azure Backup without any specific actions required to support encryption on your end. For more information about encryption with platform-managed keys, see this article.
Encryption using customer-managed keysWhen you encrypt disks with customer-managed keys (CMK), the key used for encrypting the disks is stored in the Azure Key Vault and is managed by you. Storage Service Encryption (SSE) using CMK differs from Azure Disk Encryption (ADE) encryption. ADE uses the encryption tools of the operating system. SSE encrypts data in the storage service, enabling you to use any OS or images for your VMs.
You don't need to perform any explicit actions for backup or restore of VMs that use customer-managed keys for encrypting their disks. The backup data for these VMs stored in the vault will be encrypted with the same methods as the encryption used on the vault.
For more information about encryption of managed disks with customer-managed keys, see this article.
Encryption support using ADEAzure Backup supports backup of Azure VMs that have their OS/data disks encrypted with Azure Disk Encryption (ADE). ADE uses BitLocker for encryption of Windows VMs, and the dm-crypt feature for Linux VMs. ADE integrates with Azure Key Vault to manage disk-encryption keys and secrets. Key Vault Key Encryption Keys (KEKs) can be used to add an additional layer of security, encrypting encryption secrets before writing them to Key Vault.
Azure Backup can back up and restore Azure VMs using ADE with and without the Microsoft Entra app, as summarized in the following table.
VM disk type ADE (BEK/dm-crypt) ADE and KEK Unmanaged Yes Yes Managed Yes Yes LimitationsBefore you back up or restore encrypted Azure VNs, review the following limitations:
Before you start, do the following:
In addition, there are a couple of things that you might need to do in some circumstances:
To configure a backup policy, follow these steps:
If you haven't yet created a Recovery Services backup vault, follow these instructions.
Navigate to Backup center and click +Backup from the Overview tab
Select Azure Virtual machines as the Datasource type and select the vault you have created, then click Continue.
Select the policy that you want to associate with the vault, then select OK.
If you don't want to use the default policy, select Create New, and create a custom policy.
Under Virtual Machines, select Add.
Choose the encrypted VMs you want to back up using the select policy, and select OK.
If you're using Azure Key Vault, on the vault page, you'll see a message that Azure Backup needs read-only access to the keys and secrets in the Key Vault.
If you receive this message, no action is required.
If you receive this message, you need to set permissions as described in the procedure below.
Select Enable Backup to deploy the backup policy in the vault, and enable backup for the selected VMs.
To enable backups for ADE encrypted VMs using Azure RBAC enabled key vaults, you need to assign Key Vault Administrator role to the Backup Management Service Microsoft Entra app by adding a role assignment in Access Control of key vault.
Note
VM Backup operations use the Backup Management Service app instead of Recovery Services vault Managed Service Identity (MSI) to access Key Vault. You must grant the necessary Key Vault permissions to this app for backups to function properly.
Learn about the different available roles. The Key Vault Administrator role can allow permissions to get, list, and back up both secret and key.
For Azure RBAC enabled key vaults, you can create custom role with the following set of permissions. Learn how to create custom role.
Note
When you use Azure Government, ensure that the Key Vault Administratorâ¯role is assigned to the Backup Fairfax Entra Applicationâ¯to enable proper access and functionality.
Action Description Microsoft.KeyVault/vaults/keys/backup/action Creates the backup file of a key. Microsoft.KeyVault/vaults/secrets/backup/action Creates the backup file of a secret. Microsoft.KeyVault/vaults/secrets/getSecret/action Gets the value of a secret. Microsoft.KeyVault/vaults/keys/read List keys in the specified vault or read properties and public materials. Microsoft.KeyVault/vaults/secrets/readMetadata/action List or view the properties of a secret, but not its values."permissions": [
{
"actions": [],
"notActions": [],
"dataActions": [
"Microsoft.KeyVault/vaults/keys/backup/action",
"Microsoft.KeyVault/vaults/secrets/backup/action",
"Microsoft.KeyVault/vaults/secrets/getSecret/action",
"Microsoft.KeyVault/vaults/keys/read",
"Microsoft.KeyVault/vaults/secrets/readMetadata/action"
],
"notDataActions": []
}
]
Trigger a backup job
The initial backup will run in accordance with the schedule, but you can run it immediately as follows:
Azure Backup needs read-only access to back up the keys and secrets, along with the associated VMs.
To provide Azure RBAC permissions on Key Vault, see this article.
To set permissions:
In the Azure portal, select All services, and search for Key vaults.
Select the key vault associated with the encrypted VM you're backing up.
Tip
To identify a VM's associated key vault, use the following PowerShell command. Substitute your resource group name and VM name:
Get-AzVm -ResourceGroupName "MyResourceGroup001" -VMName "VM001" -Status
Look for the key vault name in this line:
SecretUrl : https://<keyVaultName>.vault.azure.net
Select Access policies > Add Access Policy.
In Add access policy > Configure from template (optional), select Azure Backup.
Select Add. Backup Management Service is added to Access policies.
Select Save to provide Azure Backup with the permissions.
You can also set the access policy using PowerShell or CLI.
Next stepRestore encrypted Azure virtual machines
If you run into any issues, review these articles:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4