I am attempting to move a resource group (that contains a VM with its dependant resources e.g. network interface etc) to a new subscription and resource group. (the move works fine if done via the GUI)
My Script:
foreach ($resource in $resources) {Move-AzureRmResource
-DestinationResourceGroupName "newresourcegroup" -ResourceId $resource.resourceID -DestinationSubscriptionId 123456}
Its failing with
Move-AzureRmResource : {"error":{"code":"ResourceMoveProviderValidationFailed","message":"Resource move validation failed. Please see details. Diagnostic information: timestamp
etc...
"The move resources request does not contain all the dependent resources. Please check error details for missing resource ids.\"}],\"code\":\"MissingMoveDependentResources\",\"message\":\"The move resources request does not contain all the dependent resources. Please check error details for missing resource ids.\"}}"},{"target":"Microsoft.Network/networkInterfaces","message":"{\"error\":{\"code\":\"MissingMoveDependentResources\",\"message\":\"The move resources request does not contain all the dependent resources. Please check details for missing resource Ids
Clearly I need to specify the dependant resources somehow, but there doesn't appear to be a parameter for "dependant resources" for the Move-AzureRmResource module.
a. How can I determine what the dependant resources are?
b. How do I specify them in the move cmdlet?