Share via

Created resource in wrong RG. How can we move them?

ammy J 40 Reputation points
2026-03-20T13:41:09.04+00:00

Created resource in wrong RG. How can we move them?
Thanks in advance!

Azure Advisor
Azure Advisor

An Azure personalized recommendation engine that helps users follow best practices to optimize Azure deployments.

0 comments No comments

Answer accepted by question author
  1. Naveena Patlolla 9,310 Reputation points Microsoft External Staff Moderator
    2026-03-20T13:48:56.5766667+00:00

    Hi ammy J
    Yes, resources created in the wrong resource group can be moved to the correct one in Microsoft Azure, please follow the below options.

    Option 1: Azure Portal

    Go to the source resource group

    Click “Move” → “Move to another resource group”

    Select the resources you want to move

    Choose the target resource group

    Validate and click Move

    Option 2:

    Move-AzResource -DestinationResourceGroupName "TargetRG" -ResourceId "/subscriptions/{subId}/resourceGroups/{sourceRG}/providers/{resourceProvider}/{resourceType}/{resourceName}"
    

    Option 3:

    az resource move --destination-group TargetRG --ids /subscriptions/{subId}/resourceGroups/{sourceRG}/providers/{resourceProvider}/{resourceType}/{resourceName}
    

    Please note:

    The source and destination resource groups must be within the same subscription.

    Some resource types may not support the move operation.

    If there are dependencies, all related resources must be moved together.

    If the move option is not available or validation fails, the alternative would be to recreate the resources in the correct resource group and migrate the configuration/data accordingly.

    Please let me know if you face any challenge here, I can help you to resolve this issue further

    Provide your valuable Comments.

    Please do not forget to "Accept the answer” and “upvote it” wherever the information provided helps you, this can be beneficial to other community members.it would be greatly appreciated and helpful to others.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Q&A Assist
    2026-03-20T13:41:19.4066667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    Resources can be moved between resource groups using Azure Resource Manager tools, as long as the resource type supports moves.

    Using Azure CLI:

    1. Get the resource IDs for the resources to move, for example:
         webapp=$(az resource show -g OldRG -n ExampleSite --resource-type "Microsoft.Web/sites" --query id --output tsv)
         plan=$(az resource show -g OldRG -n ExamplePlan --resource-type "Microsoft.Web/serverfarms" --query id --output tsv)
      
    2. Run the move command to the destination resource group:
         az resource move --destination-group NewRG --ids $webapp $plan
      
    3. To move to another subscription as well, add --destination-subscription-id <subscription-id>.

    Using Azure PowerShell:

    1. Identify the resources in the source resource group:
         $sourceName = "sourceRG"
         $destinationName = "destinationRG"
         $resourcesToMove = @("app1", "app2")
         
         $resources = Get-AzResource -ResourceGroupName $sourceName | Where-Object { $_.Name -in $resourcesToMove }
      
    2. Move them to the destination resource group:
         Move-AzResource -DestinationResourceGroupName $destinationName -ResourceId $resources.ResourceId
      
    3. To move to a different subscription, include -DestinationSubscriptionId <subscription-id>.

    Before moving, it is recommended to validate the move (for example, using az resource invoke-action or Invoke-AzResourceAction) to ensure the resource types and dependencies support being moved.


    References:

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.