Reputation: 2899
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.
Upvotes: 16
Views: 13177
Reputation: 539
This is something at Azure's end, and internally, the operation takes longer than what it shows on the console. For example, if the storage account or database is larger, then the operation can take up to 4 hours to finish internally. The console shows the operation is complete, which is not true. You should be able to perform operations after a few hours.
Upvotes: 1
Reputation: 31
There are two phases in a move request. In the first phase, the resource is moved. In the second phase, notifications are sent to other resource providers that are dependent on the resource being moved. A resource group can be locked for the entire four hours when a resource provider fails either phase. During the allowed time, Resource Manager retries the failed step.
If a resource can't be moved within four hours, Resource Manager unlocks both resource groups. Resources that were successfully moved are in the destination resource group. Resources that failed to move are left the source resource group.
Upvotes: 2
Reputation: 906
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://learn.microsoft.com/en-us/azure/azure-resource-manager/resource-group-move-resources
Upvotes: 4