I was doing some cleanup moving some Azure Cloud Services to a newly created Resource group with the following command
Find-AzureRmResource -ResourceNameContains "oldresourcename" |
Move-AzureRmResource -DestinationResourceGroupName "newresourcegroup" -Verbose
Everything was going fine, but the last one I ran seems to be taking a very long time. It is a simple CS with one worker role and one web role and small size.
The command has been in a not completed state for over an hour, and out on the Portal, both resource groups have "Moving Resources" in purple at the top of the page. I am going to wait until tomorrow to see if it still persists, but it should not be taking this long.
Is there a way to cancel or halt this operation? The concern is that both Resource Groups are locked till this process is complete, which will be an issue moving forward.
You can use the Azure portal, Azure PowerShell, Azure CLI, or the REST API to move resources. Both the source group and the target group are locked during the move operation. Write and delete operations are blocked on the resource groups until the move completes.
Both the source group and the target group are locked during the move operation. Write and delete operations are blocked on the resource groups until the move completes. This lock means you can't add, update, or delete resources in the resource groups.
To move to a new subscription, include a value for the DestinationSubscriptionId parameter. Use Azure CLI. To move existing resources to another resource group or subscription, use the az resource move command. Provide the resource IDs of the resources to move. The following example shows how to move several resources to a new resource group.
Moving a resource is a complex operation that has different phases. It can involve more than just the resource provider of the resource you're trying to move. Because of the dependencies between resource providers, Azure Resource Manager allows 4 hours for the operation to complete.
From my experience the move will eventually time out if there's an issue. I had a similar issue moving a web app and the SSL cert caused the move to fail, but it took a couple of hours for it to fail.
More information from Microsoft on what is able to move:
https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-move-resources
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With