Using Console
Using CLI
az vm encryption show --resource-group <resource-group-name> --name <vm-name>
Replace <resource-group-name>
with the name of the resource group in which the VM is located, and <vm-name>
with the name of the VM.
az vm encryption enable --resource-group <resource-group-name> --name <vm-name> --disk-encryption-keyvault <key-vault-name> --key-encryption-keyvault <key-vault-name> --volume-type ALL
Replace <resource-group-name>
with the name of the resource group in which the VM is located, <vm-name>
with the name of the VM, and <key-vault-name>
with the name of the key vault where encryption keys are stored.
az vm encryption show --resource-group <resource-group-name> --name <vm-name>
This command will display the encryption status of the VM.
Using Python
DefaultAzureCredential
class: