When running a restore of a virtual machine, the Azure Portal provides the basic tooling to restore a VM. However, some options are left out during the process. An issue that occurred this week with one of my customers is that they had an Azure Policy that requires that all VMs must have the option “I already have a Windows Server license” checked.
The problem is that this error will occur only at the very end of the process, after the transfer of the data from the vault — and that won’t happen until a few good minutes (perhaps hours).
You can always use PowerShell to have more flexibility and it will involve changing an ARM deployment. First, you need to restore the disks as described in this documentation link and the second step is to create the VM itself using this link.
Another possible way is to relax your Azure Policies before starting the restore process. However, this is not practical, especially when having different teams managing the policies vs. day-to-day operations like a VM restore.
More Quick Tips articles
- Using location in a consistent way in your ARM template parameters
- Using environment as variables in your Azure DevOps pipelines
- Removing Log Analytics with the soft-delete option
- Using conditions in ARM templates when deploying infrastructure-as-code
- Monitor your Azure VM from your mobile device by scanning a QR code