An Azure service that is used to provision Windows and Linux virtual machines.
Welcome to Microsoft Q&A, @Sree Aravind M I hope you are doing well today,
Beyond delete protection and permissions, I would also validate the VM state and any dependencies before running automated resize or idle operations that may be blocking ....
For Azure VMs, the main conditions to check are:
- VM is in a transitional state such as Updating, Provisioning, Starting, or Stopping.
- The VM is not fully deallocated when the target resize requires deallocation.
- The requested VM size/SKU is unavailable in the region or cannot be allocated due to capacity constraints.
- Availability Set constraints prevent the VM from being allocated to the requested size.
- Another operation is already in progress on the VM or its disks.
- A disk has an active SAS lease, for example from disk export or a backup operation.
- Disk resize prerequisites are not satisfied, particularly when crossing the 4-TiB boundary for certain disk SKUs.
- The VM is protected by another automation/policy that may start, stop, or resize it concurrently.
- Azure Policy or resource locks prevent the required operation.
- The automation identity has permission to the VM but not to a dependent resource required by the operation.
- For idle automation, verify that monitoring data is available and current; missing/stale metrics can prevent the automation from correctly identifying an idle VM.
For the resize workflow, I would check the VM's provisioningState, powerState, current SKU, pending operations, disk state/SAS leases, Availability Set configuration, and regional SKU capacity before executing the action.
Microsoft references:
https://learn.microsoft.com/en-us/troubleshoot/azure/virtual-machines/windows/allocation-failure
https://learn.microsoft.com/en-us/azure/virtual-machines/sizes/resize-vm