Hi Sirish,
Thanks for posting your query!
The error "Resource 'Microsoft.Compute/virtualMachines/' is not in a state that allows modifications" usually indicates that the VM is in a state that prevents modifications. Common causes include VM extensions being updated, resource locks, or pending operations.
Solutions:
- Check and wait for any VM extensions to complete their updates.
- Remove any resource locks using
az lock list --resource-group <rg>
. - Ensure no pending operations are affecting the VM by reviewing the activity log.
- If the VM is part of a scale set, modify the scale set properties instead.
By addressing these factors, you should be able to remediate the VMs successfully.
If the information helped address your question, please Accept the answer. This will help us and also improve searchability for others in the community who might be researching similar information.