Azure CLI - How to Update Disk Encryption Settings

430 Views Asked by At

For some reason, after resizing my VM, my disk started to point to a Key Vault that does not exist.

I need to update the "secretUrl" and the "sourceVault.id", and I've created a new Key Vault for it, however, I'm not being able to update it using azure cli (az disk...)

Using the "az disk list" I was able to collect the image presented below.

enter image description here

1

There are 1 best solutions below

0
On BEST ANSWER

SOLVED: You just have to run the following command:

az disk update --name MyDisk --resource-group MyResourceGroup --set encryptionSettingsCollection.encryptionSettings='[{"diskEncryptionKey": {"secretUrl": "https:///secrets//","sourceVault": {"id": "/subscriptions/MySubscription/resourceGroups/MyResourceGroup/providers/Microsoft.KeyVault/vaults/MyVault"}},"keyEncryptionKey": null}]'