You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/virtual-machines/linux/disk-encryption-linux-aad.md
+25-25Lines changed: 25 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,15 +49,15 @@ Use the [az vm encryption enable](/cli/azure/vm/encryption#az-vm-encryption-enab
49
49
50
50
-**Encrypt a running VM by using a client secret:**
51
51
52
-
```azurecli-interactive
52
+
```azurecli-interactive
53
53
az vm encryption enable --resource-group "MyVirtualMachineResourceGroup" --name "MySecureVM" --aad-client-id "<my spn created with CLI/my Azure AD ClientID>" --aad-client-secret "My-AAD-client-secret" --disk-encryption-keyvault "MySecureVault" --volume-type [All|OS|Data]
54
-
```
54
+
```
55
55
56
56
- **Encrypt a running VM by using KEK to wrap the client secret:**
57
57
58
-
```azurecli-interactive
58
+
```azurecli-interactive
59
59
az vm encryption enable --resource-group "MyVirtualMachineResourceGroup" --name "MySecureVM" --aad-client-id "<my spn created with CLI which is the Azure AD ClientID>" --aad-client-secret "My-AAD-client-secret" --disk-encryption-keyvault "MySecureVault" --key-encryption-key "MyKEK_URI" --key-encryption-keyvault "MySecureVaultContainingTheKEK" --volume-type [All|OS|Data]
60
-
```
60
+
```
61
61
62
62
>[!NOTE]
63
63
> The syntax for the value of the disk-encryption-keyvault parameter is the full identifier string:
- **Verify that the disks are encrypted:** To check on the encryption status of an IaaS VM, use the [az vm encryption show](/cli/azure/vm/encryption#az-vm-encryption-show) command.
68
68
69
-
```azurecli-interactive
69
+
```azurecli-interactive
70
70
az vm encryption show --name "MySecureVM" --resource-group "MyVirtualMachineResourceGroup"
71
-
```
71
+
```
72
72
73
73
- **Disable encryption:** To disable encryption, use the [az vm encryption disable](/cli/azure/vm/encryption#az-vm-encryption-disable) command. Disabling encryption is only allowed on data volumes for Linux VMs.
74
74
75
-
```azurecli-interactive
75
+
```azurecli-interactive
76
76
az vm encryption disable --name "MySecureVM" --resource-group "MyVirtualMachineResourceGroup" --volume-type DATA
77
-
```
77
+
```
78
78
79
79
### <a name="bkmk_RunningLinuxPSH"> </a> Enable encryption on an existing or running Linux VM by using PowerShell
80
80
Use the [Set-AzVMDiskEncryptionExtension](/powershell/module/az.compute/set-azvmdiskencryptionextension) cmdlet to enable encryption on a running IaaS virtual machine in Azure. Take a [snapshot](snapshot-copy-managed-disk.md) or make a backup of the VM with [Azure Backup](../../backup/backup-azure-vms-encryption.md) before the disks are encrypted. The -skipVmBackup parameter is already specified in the PowerShell scripts to encrypt a running Linux VM.
81
81
82
82
- **Encrypt a running VM by using a client secret:** The following script initializes your variables and runs the Set-AzVMDiskEncryptionExtension cmdlet. The resource group, VM, key vault, Azure AD app, and client secret should have already been created as prerequisites. Replace MyVirtualMachineResourceGroup, MyKeyVaultResourceGroup, MySecureVM, MySecureVault, My-AAD-client-ID, and My-AAD-client-secret with your values. Modify the -VolumeType parameter to specify which disks you're encrypting.
83
83
84
-
```azurepowershell
84
+
```azurepowershell
85
85
$VMRGName = 'MyVirtualMachineResourceGroup';
86
86
$KVRGname = 'MyKeyVaultResourceGroup';
87
87
$vmName = 'MySecureVM';
@@ -94,10 +94,10 @@ Use the [Set-AzVMDiskEncryptionExtension](/powershell/module/az.compute/set-azvm
- **Encrypt a running VM by using KEK to wrap the client secret:** Azure Disk Encryption lets you specify an existing key in your key vault to wrap disk encryption secrets that were generated while enabling encryption. When a key encryption key is specified, Azure Disk Encryption uses that key to wrap the encryption secrets before writing to the key vault. Modify the -VolumeType parameter to specify which disks you're encrypting.
99
99
100
-
```azurepowershell
100
+
```azurepowershell
101
101
$KVRGname = 'MyKeyVaultResourceGroup';
102
102
$VMRGName = 'MyVirtualMachineResourceGroup';
103
103
$aadClientID = 'My-AAD-client-ID';
@@ -111,7 +111,7 @@ Use the [Set-AzVMDiskEncryptionExtension](/powershell/module/az.compute/set-azvm
> The syntax for the value of the disk-encryption-keyvault parameter is the full identifier string:
@@ -121,15 +121,15 @@ Use the [Set-AzVMDiskEncryptionExtension](/powershell/module/az.compute/set-azvm
121
121
122
122
- **Verify that the disks are encrypted:** To check on the encryption status of an IaaS VM, use the [Get-AzVmDiskEncryptionStatus](/powershell/module/az.compute/get-azvmdiskencryptionstatus) cmdlet.
- **Disable disk encryption:** To disable the encryption, use the [Disable-AzureRmVMDiskEncryption](/powershell/module/az.compute/disable-azvmdiskencryption) cmdlet. Disabling encryption is only allowed on data volumes for Linux VMs.
### <a name="bkmk_RunningLinux"> </a> Enable encryption on an existing or running IaaS Linux VM with a template
@@ -263,23 +263,23 @@ In contrast to Powershell syntax, the CLI doesn't require you to provide a uniqu
263
263
264
264
-**Encrypt a running VM by using a client secret:**
265
265
266
-
```azurecli-interactive
266
+
```azurecli-interactive
267
267
az vm encryption enable --resource-group "MyVirtualMachineResourceGroup" --name "MySecureVM" --aad-client-id "<my spn created with CLI/my Azure AD ClientID>" --aad-client-secret "My-AAD-client-secret" --disk-encryption-keyvault "MySecureVault" --volume-type "Data"
268
-
```
268
+
```
269
269
270
270
- **Encrypt a running VM by using KEK to wrap the client secret:**
271
271
272
-
```azurecli-interactive
272
+
```azurecli-interactive
273
273
az vm encryption enable --resource-group "MyVirtualMachineResourceGroup" --name "MySecureVM" --aad-client-id "<my spn created with CLI which is the Azure AD ClientID>" --aad-client-secret "My-AAD-client-secret" --disk-encryption-keyvault "MySecureVault" --key-encryption-key "MyKEK_URI" --key-encryption-keyvault "MySecureVaultContainingTheKEK" --volume-type "Data"
274
-
```
274
+
```
275
275
276
276
### Enable encryption on a newly added disk with Azure PowerShell
277
277
When you use Powershell to encrypt a new disk for Linux, a new sequence version needs to be specified. The sequence version has to be unique. The following script generates a GUID for the sequence version.
278
278
279
279
280
280
- **Encrypt a running VM by using a client secret:** The following script initializes your variables and runs the Set-AzVMDiskEncryptionExtension cmdlet. The resource group, VM, key vault, Azure AD app, and client secret should have already been created as prerequisites. Replace MyVirtualMachineResourceGroup, MyKeyVaultResourceGroup, MySecureVM, MySecureVault, My-AAD-client-ID, and My-AAD-client-secret with your values. The -VolumeType parameter is set to data disks and not the OS disk. If the VM was previously encrypted with a volume type of "OS" or "All," then the -VolumeType parameter should be changed to All so that both the OS and the new data disk will be included.
281
281
282
-
```azurepowershell
282
+
```azurepowershell
283
283
$KVRGname = 'MyKeyVaultResourceGroup';
284
284
$VMRGName = 'MyVirtualMachineResourceGroup';
285
285
$vmName = 'MySecureVM';
@@ -292,10 +292,10 @@ In contrast to Powershell syntax, the CLI doesn't require you to provide a uniqu
- **Encrypt a running VM by using KEK to wrap the client secret:** Azure Disk Encryption lets you specify an existing key in your key vault to wrap disk encryption secrets that were generated while enabling encryption. When a key encryption key is specified, Azure Disk Encryption uses that key to wrap the encryption secrets before writing to the key vault. The -VolumeType parameter is set to data disks and not the OS disk. If the VM was previously encrypted with a volume type of "OS" or "All," then the -VolumeType parameter should be changed to All so that both the OS and the new data disk will be included.
297
297
298
-
```azurepowershell
298
+
```azurepowershell
299
299
$KVRGname = 'MyKeyVaultResourceGroup';
300
300
$VMRGName = 'MyVirtualMachineResourceGroup';
301
301
$vmName = 'MyExtraSecureVM';
@@ -310,7 +310,7 @@ In contrast to Powershell syntax, the CLI doesn't require you to provide a uniqu
@@ -337,7 +337,7 @@ You can disable encryption by using Azure PowerShell, the Azure CLI, or a Resour
337
337
- **Disable encryption with a Resource Manager template:** To disable encryption, use the [Disable encryption on a running Linux VM](https://aka.ms/decrypt-linuxvm) template.
338
338
1. Select **Deploy to Azure**.
339
339
2. Select the subscription, resource group, location, VM, legal terms, and agreement.
340
-
3. Select **Purchase** to disable disk encryption on a running Windows VM.
340
+
3. Select **Purchase** to disable disk encryption on a running Windows VM.
0 commit comments