|
1 | 1 | --- |
2 | | -title: Encrypt disks with customer-managed keys in an Azure Extended Zone |
3 | | -description: Learn how to use Azure Key Vault, Disk Encryption Sets, and Azure CLI to encrypt disks for virtual machines deployed in an Azure Extended Zone |
| 2 | +title: Encrypt Disks with Customer-Managed Keys in an Azure Extended Zone |
| 3 | +description: Learn how to use Azure Key Vault, Disk Encryption Sets, and the Azure CLI to encrypt disks for virtual machines deployed in an Azure extended zone. |
4 | 4 | author: svaldesgzz |
5 | 5 | ms.author: svaldes |
6 | 6 | ms.service: azure-extended-zones |
7 | 7 | ms.topic: how-to |
8 | 8 | ms.date: 03/04/2026 |
9 | 9 | --- |
10 | 10 |
|
11 | | -# Encrypt disks with customer-managed keys in an Azure Extended Zone |
| 11 | +# Encrypt disks with customer-managed keys in an Azure extended zone |
12 | 12 |
|
13 | | -In this article, you learn how to encrypt Azure managed disks with **customer-managed keys (CMK)** for virtual machines deployed in an **Azure Extended Zone**. |
| 13 | +In this article, you learn how to encrypt Azure managed disks with customer-managed keys (CMKs) for virtual machines (VMs) deployed in an Azure extended zone. |
14 | 14 |
|
15 | | -The process uses **Azure Key Vault** and a **Disk Encryption Set (DES)**. |
| 15 | +The process uses Azure Key Vault and a disk encryption set (DES). |
16 | 16 |
|
17 | 17 | > [!NOTE] |
18 | | -> While Key Vault and Disk Encryption Sets (DES) can be created using either the Azure portal or Azure CLI, assigning a Disk Encryption Set to disks for Azure Extended Zone workloads is currently supported only via Azure CLI. |
| 18 | +> You can create a key vault and a DES by using either the Azure portal or the Azure CLI. Assigning a DES to disks for Azure Extended Zones workloads is currently supported only via the Azure CLI. |
19 | 19 |
|
20 | 20 | ## Prerequisites |
21 | 21 |
|
22 | | -- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/pricing/purchase-options/azure-account?cid=msft_learn). |
| 22 | +- An Azure account with an active subscription. If you don't have an Azure account, you can [create an account for free](https://azure.microsoft.com/pricing/purchase-options/azure-account?cid=msft_learn). |
| 23 | +- Access to an extended zone. For more information, see [Request access to an Azure extended zone](request-access.md). |
| 24 | +- The Azure CLI installed (version 2.26 or later). [Install the Azure CLI](/cli/azure/install-azure-cli). |
| 25 | +- A basic understanding of Azure Key Vault and disk encryption concepts. For more information, see [Azure Key Vault documentation](/azure/key-vault/general/overview) and [Azure Disk Encryption documentation](/azure/virtual-machines/windows/disk-encryption-overview). |
23 | 26 |
|
24 | | -- Access to an Extended Zone. For more information, see [Request access to an Azure Extended Zone](request-access.md). |
| 27 | +## High-level architecture context |
25 | 28 |
|
26 | | -- Azure CLI installed (version 2.26 or later). [Install Azure CLI](/cli/azure/install-azure-cli). |
| 29 | +When you use CMKs with Azure Extended Zones resources: |
27 | 30 |
|
28 | | -- Basic understanding of Azure Key Vault and disk encryption concepts. For more information, see [Azure Key Vault documentation](/azure/key-vault/general/overview) and [Azure Disk Encryption documentation](/azure/virtual-machines/windows/disk-encryption-overview). |
| 31 | +- Control plane operations (Azure Resource Manager, Key Vault metadata, and DES) run in the parent Azure region. |
| 32 | +- Data plane resources (VMs and disks) run in the extended zone location. |
| 33 | +- Disk encryption is enforced at the managed disk level (data plane) by using a DES. |
29 | 34 |
|
30 | | -## High-level architecture context |
| 35 | +## Create a key vault, encryption key, and DES in an Azure extended zone's parent region |
31 | 36 |
|
32 | | -When using customer-managed keys with Azure Extended Zones resources: |
33 | | -- Control plane operations (Azure Resource Manager, Key Vault metadata, DES) run in the parent Azure region. |
34 | | -- Data plane resources (virtual machines and disks) run in the Extended Zone location. |
35 | | -- Disk encryption is enforced at the managed disk level (data plane) using a Disk Encryption Set. |
| 37 | +In this section, you create a key vault, an encryption key, and DES in the parent region of an extended zone. |
36 | 38 |
|
37 | | -## Create a Key Vault, encryption key and Disk Encryption Set in an Azure Extended Zone's parent region |
| 39 | +For this example, you choose which tool to use to create the encryption tools. Disk creation and encryption work only via the Azure CLI. |
38 | 40 |
|
39 | | -In this section, you create a Key Vault, encryption key and Disk Encryption Set in the parent region of an Extended Zone. |
| 41 | +### Create a key vault and an encryption key |
40 | 42 |
|
41 | | -For this example, you have flexibility as to which tool to use to create the encryption tools, but the disk creation and encryption will only work via Azure CLI. |
| 43 | +To encrypt resources in an Azure extended zone, you must first create an Azure key vault and an RSA key *in the parent Azure region associated with your extended zone*. You can do this task by using the Azure portal. You can also use the Azure CLI or Azure PowerShell. When you create the key vault, ensure that the following tasks occurred: |
42 | 44 |
|
43 | | -### Create a Key Vault and encryption key |
44 | | -To encrypt resources in an Azure Extended Zone, you must first create an Azure Key Vault and an RSA key **in the parent Azure region associated with your Extended Zone**. You can do this using the Azure portal, or Azure CLI / PowerShell. When creating the Key Vault, ensure the following: |
45 | 45 | - All the resources belong to the same resource group. |
46 | | -- Azure role-based access control (RBAC) is enabled. |
| 46 | +- Azure role-based access control is enabled. |
47 | 47 | - Purge protection is enabled. |
48 | | -- You create or import an RSA key (2048-bit or higher). |
| 48 | +- An RSA key (2048-bit or later) is created or imported. |
49 | 49 |
|
| 50 | +## Create a disk encryption set |
50 | 51 |
|
51 | | -## Create a Disk Encryption Set (DES) |
52 | | -Next, create a Disk Encryption Set that references the Key Vault key. The Disk Encryption Set must: |
53 | | -- Be created in the same parent region as the Key Vault. |
| 52 | +Next, create a DES that references the Key Vault key. The DES must: |
| 53 | + |
| 54 | +- Be created in the same parent region as the key vault. |
54 | 55 | - Use a system-assigned managed identity. |
55 | 56 |
|
56 | | -Grant the Disk Encryption Set access to the Key Vault key by assigning it the Key Vault Crypto Service Encryption User role. |
| 57 | +Grant the DES access to the Key Vault key by assigning it the Key Vault Crypto Service Encryption User role. |
57 | 58 |
|
58 | | -## Deploy a virtual machine in an Azure Extended Zone |
59 | | -When deploying a virtual machine in an Azure Extended Zone, you must specify: |
| 59 | +## Deploy a virtual machine in an Azure extended zone |
60 | 60 |
|
61 | | ---location: the parent Azure region |
| 61 | +When you deploy a VM in an Azure extended zone, you must specify: |
62 | 62 |
|
63 | | ---edge-zone: the Extended Zone name |
| 63 | +* `--location`: The parent Azure region. |
| 64 | +* `--edge-zone`: The extended zone name. |
64 | 65 |
|
65 | | -The following example creates a Windows Server 2022 VM in the Los Angeles Extended Zone, using West US as the parent region. |
| 66 | +The following example creates a Windows Server 2022 VM in the Los Angeles extended zone by using West US as the parent region. |
66 | 67 |
|
67 | 68 | ```cli |
68 | 69 | az vm create --resource-group 'myResourceGroup' --name 'myVM' --image Win2022Datacenter --size Standard_DS4_v2 --admin-username 'username' --admin-password 'password' --edge-zone losangeles --location westus |
69 | 70 |
|
70 | 71 | ``` |
71 | 72 |
|
72 | | -## Create an encrypted managed disk using a Disk Encryption Set (CLI only) |
| 73 | +## Create an encrypted managed disk by using a DES (CLI only) |
73 | 74 |
|
74 | | -After creating the VM, create a managed disk encrypted with your Disk Encryption Set. This step explicitly applies customer-managed keys to the disk. |
| 75 | +After you create the VM, create a managed disk encrypted with your DES. This step explicitly applies CMKs to the disk. |
75 | 76 |
|
76 | 77 | ```cli |
77 | 78 | az disk create --resource-group 'myResourceGroup' --name 'myDisk' --edge-zone losangeles --location westus --size 64 --sku Premium_LRS --encryption-type EncryptionAtRestWithCustomerKey --disk-encryption-set DES_ID |
78 | 79 | ``` |
79 | 80 |
|
80 | 81 | ### Verify disk encryption |
81 | 82 |
|
82 | | -Use the following command to confirm that the disk is encrypted with a customer-managed key and associated with the correct Disk Encryption Set: |
| 83 | +Use the following command to confirm that the disk is encrypted with a CMK and associated with the correct DES: |
83 | 84 |
|
84 | 85 | ``` cli |
85 | 86 | az disk show -g 'myResourceGroup' -n 'myDisk' --query "{encryptionType:encryption.type, desId:encryption.diskEncryptionSetId}" -o json |
86 | 87 | ``` |
| 88 | + |
87 | 89 | ### Attach the encrypted disk to the VM |
88 | 90 |
|
89 | | -Finally, once verified, attach the encrypted disk to the VM using the following command: |
| 91 | +After verification, attach the encrypted disk to the VM by using the following command: |
| 92 | + |
90 | 93 | ```cli |
91 | 94 | az vm disk attach --resource-group 'myResourceGroup' --vm-name 'myVM' --name 'myDisk' |
92 | 95 | ``` |
93 | 96 |
|
94 | 97 | ## Clean up resources |
95 | | -If you're done working with resources from this tutorial, use the following instructions to delete the resource group and all resources it contains: |
| 98 | + |
| 99 | +If you're finished working with resources from this tutorial, follow these instructions to delete the resource group and all the resources that it contains: |
96 | 100 |
|
97 | 101 | ```cli |
98 | 102 | az group delete --name 'myResourceGroup' --yes --no-wait |
99 | 103 | ``` |
100 | 104 |
|
101 | 105 | ## Related content |
| 106 | + |
102 | 107 | - [Azure Key Vault documentation](/azure/key-vault/general/overview) |
103 | 108 | - [What is Azure Extended Zones?](overview.md) |
104 | | -- [Deploy a virtual machine in an Extended Zone](deploy-vm-portal.md) |
| 109 | +- [Deploy a virtual machine in an extended zone](deploy-vm-portal.md) |
105 | 110 | - [Frequently asked questions](faq.md) |
0 commit comments