Move a set of Azure resources from one subscription to another

BONIER Charline 0 Reputation points

I have created a Powershell script that allows me to move resources in a DEV subscription to a resource group in a PROD subscription.

When I run the script: it runs and runs but does not stop so I stop the execution however when I look in Azure my resources have been moved.

Do you know how I can fix the problem ?

Here is the script

$resources = Get-AzResource -Name * -ResourceGroupName "Name"
Move-AzResource -DestinationResourceGroupName "Test" -DestinationSubscriptionId "ID" -ResourceId $resources.Id -Force

I looked in the Azure documentation but couldn't find anything : Link :

Azure Resource Mover
Azure Resource Mover
An Azure service used for moving multiple resources between Azure regions.
200 questions
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,032 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Rohit Kumar Sinha 1,321 Reputation points

    HI ,

    You can use Azure Resource Mover , which is the native and seamless option to do this. Please refer to the below doc on how to configure this , which is fairly easy

    0 comments No comments