Article guideContents, topics, tags, and RSS
Azure Resource Manager can move many resources to another resource group, another subscription, or both. You can use the portal for an interactive move or automate the same operation with the current Az PowerShell module.
Do not treat a whole resource group as one portable object. Azure validates each resource type and its dependencies, and some related resources must move together.
Check the move before running it
Read Microsoft’s current move-resource guidance and the linked support matrix for every resource type in the group.
For a cross-subscription move, confirm that:
- the source and destination subscriptions belong to the same Microsoft Entra tenant;
- your account can read and move the source resources and write to the destination group;
- the destination subscription has enough quota;
- required resource providers are registered in the destination subscription;
- dependent resources are included in the same move when Azure requires it;
- resource locks and service-specific restrictions have been handled.
Resource IDs change when a resource moves to a different group or subscription. Review scripts, dashboards, alerts, role assignments, and any configuration that stores a resource ID. Azure also locks the affected resource groups for create, update, and delete operations while the move is in progress, although existing workloads normally continue running.
Move the resources with PowerShell
Install or update the Az PowerShell module, then replace the example identifiers:
$ErrorActionPreference = "Stop"
$sourceSubscriptionId = "11111111-1111-1111-1111-111111111111"
$destinationSubscriptionId = "22222222-2222-2222-2222-222222222222"
$sourceResourceGroup = "ResourceGroupOld"
$destinationResourceGroup = "ResourceGroupNew"
$destinationLocation = "swedencentral"
Connect-AzAccount
# Create the destination group if it does not exist.
Set-AzContext -SubscriptionId $destinationSubscriptionId
if (-not (Get-AzResourceGroup -Name $destinationResourceGroup -ErrorAction SilentlyContinue)) {
New-AzResourceGroup -Name $destinationResourceGroup -Location $destinationLocation
}
# Collect the complete resource IDs from the source group.
Set-AzContext -SubscriptionId $sourceSubscriptionId
$resourceIds = @(
Get-AzResource -ResourceGroupName $sourceResourceGroup |
Select-Object -ExpandProperty ResourceId
)
if ($resourceIds.Count -eq 0) {
throw "No resources were found in $sourceResourceGroup."
}
Move-AzResource -ResourceId $resourceIds -DestinationResourceGroupName $destinationResourceGroup -DestinationSubscriptionId $destinationSubscriptionId -Force
Move-AzResource submits the set as one move request. If Azure reports that a dependency is missing or a resource type cannot move, correct the set instead of filtering out the error and moving an incomplete application.
Register missing providers
A destination subscription may not yet be registered for every provider used by the source resources. List the namespaces represented in the group:
Set-AzContext -SubscriptionId $sourceSubscriptionId
$providerNamespaces = Get-AzResource -ResourceGroupName $sourceResourceGroup |
ForEach-Object { $_.ResourceType.Split('/')[0] } |
Sort-Object -Unique
$providerNamespaces
Then register the required namespaces in the destination subscription:
Set-AzContext -SubscriptionId $destinationSubscriptionId
foreach ($namespace in $providerNamespaces) {
Register-AzResourceProvider -ProviderNamespace $namespace
}
Provider registration can take time. Check Get-AzResourceProvider -ProviderNamespace <namespace> and wait for RegistrationState to become Registered before retrying the move.
Verify after the move
When Azure reports success:
- Confirm every expected resource appears in the destination group.
- Test application traffic, networking, identities, secrets, and monitoring.
- Update references to changed resource IDs.
- Recreate role assignments or other configuration that did not move with the resource.
- Remove the empty source group only after the application has been verified.
The portal and REST API expose the same underlying validation. For automation details and current parameters, see the official Move-AzResource reference.
