Physical Address

304 North Cardinal St.
Dorchester Center, MA 02124

Move Azure resource group to another subscription

If you would like to move all the Azure resources from an a source resource group to a target another resource group in another subscription, you can do that by the portal or the Azure CLI. See Azure CLI code below

az login --service-principal --username 'servicePrincipalGuid' --password 'Secret' --tenant 'tenantGuid'

az account set --subscription 'subscriptionGuid' #old subscription

az resource move --destination-group 'destinationResourceGroupName' --destination-subscription-id 'destinationSubscriptionGuid' --ids $(az resource list --resource-group 'sourceResourceGroupName' --query "[].id" -o tsv)

If you get the error below, it is because there are some dependencies with other Azure resources in another resource group or because you need to move them first back to the original resource group. See below how to troubleshoot

(ResourceMoveProviderValidationFailed) Resource move validation failed. Please see details. Diagnostic information: timestamp '20250619T072648Z', subscription id 'subscriptionGuid', tracking id 'someGuid', request correlation id 'someGuid'.

Code: ResourceMoveProviderValidationFailed

Message: Resource move validation failed. Please see details. Diagnostic information: timestamp '20250619T072648Z', subscription id 'someGuid', tracking id 'someGuid', request correlation id 'someGuid'.

Exception Details:      (UnsupportedOperation) The api connection 'microsoftforms' is of type v2 and cannot be moved. The move of V2 api connection is not yet supported. Please create a new connection with a different name.

        Code: UnsupportedOperation

        Message: The api connection 'microsoftforms' is of type v2 and cannot be moved. The move of V2 api connection is not yet supported. Please create a new connection with a different name.

        Target: Microsoft.Web/connections       (ResourceMoveProviderValidationFailed) {"Code":"BadRequest","Message":"Please select all the Microsoft.Web resources from 'rg-m365-sp-azl-test' resource group for cross-subscription migration. Also, please ensure destination resource group 'someResourceGroup' doesn't have any Microsoft.Web resources before move operation. Here is the list of resources you have to move together: az-logic-app-alz-test (Microsoft.Web/sites). This resource is located in resource group 'someResourceGroupName', but hosted in the resource group 'someResourceGroupName'. This may be a result of prior move operations. Move it back to respective hosting resource group\r\n ASP-someName-ba8b (Microsoft.Web/serverFarms)\r\n. Please check https://portal.azure.com/?websitesextension_ext=asd.featurePath%3Ddetectors%2FMigration#resource/subscriptions/someGuid/resourceGroups/someResourceGroupName/providers/Microsoft.Web/sites/someAzureLogicAppName/troubleshoot for more information.","Target":null

Go to Azure portal–> Go to App service–> Go to Diagnose and Solve problems–> Go to configuration and management–> Go to migration operations

In this troubleshoot page you will see what are the dependencies you first need to fix to move succesfully to the target.

Leave a Reply

Your email address will not be published. Required fields are marked *