Hello shirure param,
Greetings! Welcome to Microsoft Q&A Platform.
As said above. This error typically occurs when the user does not have the necessary permissions to read the keys in the Key Vault.
Encrypting or disabling encryption may cause a VM to reboot. ( Then only necessary changes will take place)
For Azure Disk Encryption, we can break it down into two processes - extension installation and encryption.
Extension installation: This can be thought of as after you hit "enter" to run "Set-AzVMDiskEncryptionExtension". The install process itself should take about 5-10 minutes. Almost simultaneously, once the extension is installed, BitLocker will start checking your OS to see if it's compatible for ADE (size, formatting, partitioning, etc.), If it's not you'll error, if it is we can move to the encryption process.
Encryption: This process is where BitLocker will prepare your OS for disk encryption (system partition created), generate protectors, communicate with the Azure Key Vault to create secrets, and return an output. Once your VM is prepared for ADE you'll receive a "successful/true" type of response for encryption. However, if your VM failed at any point when preparing for encryption, you'll receive an error message.
Assuming all goes well, you'll receive that "successful/true" response once your VM is prepared for ADE but before encryption finishes on your disks. Encryption time depends on the size of your disk(s). As an example, if you're using a 30GB OS disk, it can take about 20minutes to encrypt. However, if you're using a 30GB OS disk along with two 1TB data disks, encryption can take longer than 20minutes.
Additional information: Azure Disk Encryption FAQ
Please consider checking the following factors to resolve the issue,
- Check if the VM meets the prerequisites for Azure Disk Encryption. Ensure that the VM is running a supported operating system and is in a supported region. You can find the list of supported VMs and operating systems in the Azure documentation.
- Check if the VM has the latest updates installed. Ensure that the VM has the latest updates installed for the operating system and the Azure Disk Encryption extension.
- Check if the VM has the required permissions. Ensure that the VM has the required permissions to access the Key Vault and the storage account.
- · Please ensure that "Enable access to Azure Resource Manager for Template Deployment" is checked in your Key Vault access policies. https://stackoverflow.microsoft.com/questions/205616
Hope this information helps! Please let us know if you have any further queries. I’m happy to assist you further.
Please "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.