so i have been trying this for a while .I pass the below payload to the Patch rest API. My vault is created with ADE encryption enabled with all permissions set.
payload1 = '{
"properties": {
"diskSizeGB": "",
"encryptionSettingsCollection": {
"enabled": "true",
"encryptionSettings": [{
"diskEncryptionKey": {
"sourceVault": {
"id": "/subscriptions/xyz/resourceGroups/xyz/providers/Microsoft.KeyVault/vaults/xyz"
},
"secretUrl": "https://xyz.vault.azure.net/secrets/secret_name/version"
}
}],
"encryptionSettingsVersion": "1.1"
}
}
}'
I get the below error's "
MsRestAzure::AzureOperationError: OperationNotAllowed: Cannot change the encryption settings of disk xyz while it is attached to running VM
Also can i please get a solution with respect to rest api's to enable the ADE encryption without giving the secret name and version in the payload and azure manages it