Skip to content

Commit 52e050f

Browse files
Merge pull request #303511 from mumian/0729-move-rg-sub
format the article
2 parents b12a6ce + eeeddc8 commit 52e050f

File tree

1 file changed

+42
-41
lines changed

1 file changed

+42
-41
lines changed

articles/azure-resource-manager/management/move-resource-group-and-subscription.md

Lines changed: 42 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Move Azure resources to a new resource group or subscription
33
description: Learn how to move resources to a new resource group or subscription, and understand the steps to ensure a successful move operation.
44
ms.topic: conceptual
5-
ms.date: 02/11/2025
5+
ms.date: 07/29/2025
66
ms.custom: devx-track-azurecli, devx-track-azurepowershell, devx-track-arm-template, devx-track-python
77
content_well_notification:
88
- AI-contribution
@@ -63,48 +63,49 @@ Some important steps precede moving a resource. You can avoid errors if you veri
6363
6464
1. Some services have specific limitations or requirements when moving resources. Check the following move guidance before moving resources within these services:
6565
66-
- If you're using Azure Stack Hub, you can't move resources between groups.
67-
- [Azure App Services](./move-limitations/app-service-move-limitations.md)
68-
- [Azure DevOps Services](/azure/devops/organizations/billing/change-azure-subscription?toc=/azure/azure-resource-manager/toc.json)
69-
- [Classic deployment model](./move-limitations/classic-model-move-limitations.md) for classic compute, storage, virtual networks, and cloud services
70-
- [Cloud Services (extended support)](./move-limitations/classic-model-move-limitations.md)
71-
- [Networking](./move-limitations/networking-move-limitations.md)
72-
- [Azure Recovery Services](../../backup/backup-azure-move-recovery-services-vault.md?toc=/azure/azure-resource-manager/toc.json)
73-
- [Virtual machines](./move-limitations/virtual-machines-move-limitations.md)
74-
- To move an Azure subscription to a new management group, see [Move subscriptions](../../governance/management-groups/manage.md#move-management-groups-and-subscriptions).
66+
- If you're using Azure Stack Hub, you can't move resources between groups.
67+
68+
- [Azure App Services](./move-limitations/app-service-move-limitations.md)
69+
- [Azure DevOps Services](/azure/devops/organizations/billing/change-azure-subscription?toc=/azure/azure-resource-manager/toc.json)
70+
- [Classic deployment model](./move-limitations/classic-model-move-limitations.md) for classic compute, storage, virtual networks, and cloud services
71+
- [Cloud Services (extended support)](./move-limitations/classic-model-move-limitations.md)
72+
- [Networking](./move-limitations/networking-move-limitations.md)
73+
- [Azure Recovery Services](../../backup/backup-azure-move-recovery-services-vault.md?toc=/azure/azure-resource-manager/toc.json)
74+
- [Virtual machines](./move-limitations/virtual-machines-move-limitations.md)
75+
- To move an Azure subscription to a new management group, see [Move subscriptions](../../governance/management-groups/manage.md#move-management-groups-and-subscriptions).
7576
7677
1. The destination subscription must be registered for the resource provider of the resource you're moving. If it's not, you receive an error stating that the **subscription isn't registered for a resource type**. You might see this error when moving a resource to a new subscription, but you didn't previously use the resource type in the subscription.
7778
7879
# [Azure CLI](#tab/azure-cli)
79-
80+
8081
To get the registration status:
81-
82+
8283
```azurecli-interactive
8384
az account set -s <destination-subscription-name-or-id>
8485
az provider list --query "[].{Provider:namespace, Status:registrationState}" --out table
8586
```
86-
87+
8788
To register a resource provider:
88-
89+
8990
```azurecli-interactive
9091
az provider register --namespace Microsoft.Batch
9192
```
92-
93+
9394
# [Azure PowerShell](#tab/azure-powershell)
94-
95+
9596
To get the registration status:
96-
97+
9798
```azurepowershell-interactive
9899
Set-AzContext -Subscription <destination-subscription-name-or-id>
99100
Get-AzResourceProvider -ListAvailable | Select-Object ProviderNamespace, RegistrationState
100101
```
101-
102+
102103
To register a resource provider:
103-
104+
104105
```azurepowershell-interactive
105106
Register-AzResourceProvider -ProviderNamespace Microsoft.Batch
106107
```
107-
108+
108109
---
109110
110111
1. Before starting a move operation, check the subscription quota for the subscription to which you're moving resources. Verify if you can request an increase in a quota that would cause a destination subscription to exceed its limit. For detailed guidance about limits and how to request an increase, see [Azure subscription and service limits, quotas, and constraints](../../azure-resource-manager/management/azure-subscription-service-limits.md).
@@ -121,7 +122,7 @@ Some important steps precede moving a resource. You can avoid errors if you veri
121122
1. **For a move across subscriptions, the resource and its dependent resources must be located in the same resource group and they must be moved together.** For example, a virtual machine with managed disks requires you to move the virtual machine, managed disks, and other dependent resources together.
122123
123124
If you're moving a resource to a new subscription, check if the resource has any dependent resources and if they're located in the same resource group. If the resources aren't in the same resource group, check if you can combine them into the same resource group. If you can, use one move operation across resource groups to consolidate all the resources into the same resource group.
124-
125+
125126
For more information, see [Scenario for move across subscriptions](#scenario-for-moving-across-subscriptions).
126127
127128
## Scenario for moving across subscriptions
@@ -142,37 +143,37 @@ Moving resources from one subscription to another is a three-step process. To il
142143
143144
1. Select the resources that you want to move. To move all of the resources, select the checkbox at the top of list. Or, select resources individually.
144145
145-
:::image type="content" source="./media/move-resource-group-and-subscription/select-resources-to-move.png" alt-text="Screenshot of the Azure portal showing the selection of resources to move.":::
146+
:::image type="content" source="./media/move-resource-group-and-subscription/select-resources-to-move.png" alt-text="Screenshot of the Azure portal showing the selection of resources to move.":::
146147
147148
1. Select the **Move** button.
148149
149-
:::image type="content" source="./media/move-resource-group-and-subscription/select-move.png" alt-text="Screenshot of the Azure portal displaying the Move button with three options.":::
150-
150+
:::image type="content" source="./media/move-resource-group-and-subscription/select-move.png" alt-text="Screenshot of the Azure portal displaying the Move button with three options.":::
151+
151152
This button gives you three options:
152-
153+
153154
- Move to a new resource group.
154155
- Move to a new subscription.
155-
- Move to a new region. To change regions, see [Move resources across regions (from resource group) with Azure Resource Mover](../../resource-mover/move-region-within-resource-group.md?toc=/azure/azure-resource-manager/management/toc.json).
156+
- Move to a new region. To change regions, see [Move resources across regions (from resource group) with Azure Resource Mover](../../resource-mover/move-region-within-resource-group.md?toc=/azure/azure-resource-manager/management/toc.json).
156157
157158
1. Select if you're moving the resources to a new resource group or subscription.
158159
159160
1. The source resource group sets automatically. Specify the destination resource group. If you're moving to a new subscription, specify this option. Select **Next**.
160161
161-
:::image type="content" source="./media/move-resource-group-and-subscription/select-destination-group.png" alt-text="Screenshot of the Azure portal where the user specifies the destination resource group for the move operation.":::
162+
:::image type="content" source="./media/move-resource-group-and-subscription/select-destination-group.png" alt-text="Screenshot of the Azure portal where the user specifies the destination resource group for the move operation.":::
162163
163164
1. The portal validates that the resources can be moved. Wait for validation to complete.
164165
165-
:::image type="content" source="./media/move-resource-group-and-subscription/validation.png" alt-text="Screenshot of the Azure portal showing the validation process for the move operation.":::
166+
:::image type="content" source="./media/move-resource-group-and-subscription/validation.png" alt-text="Screenshot of the Azure portal showing the validation process for the move operation.":::
166167
167168
1. When validation completes successfully, select **Next**.
168169
169170
1. Acknowledge that you need to update tools and scripts for these resources. To start moving the resources, select **Move**.
170171
171-
:::image type="content" source="./media/move-resource-group-and-subscription/acknowledge-change.png" alt-text="Screenshot of the Azure portal where the user acknowledges the need to update tools and scripts before starting the move operation.":::
172+
:::image type="content" source="./media/move-resource-group-and-subscription/acknowledge-change.png" alt-text="Screenshot of the Azure portal where the user acknowledges the need to update tools and scripts before starting the move operation.":::
172173
173174
1. The Azure portal notifies you when the move completes.
174175
175-
:::image type="content" source="./media/move-resource-group-and-subscription/view-notification.png" alt-text="Screenshot of the Azure portal displaying a notification with the results of the move operation.":::
176+
:::image type="content" source="./media/move-resource-group-and-subscription/view-notification.png" alt-text="Screenshot of the Azure portal displaying a notification with the results of the move operation.":::
176177
177178
### Use the Azure CLI
178179
@@ -414,19 +415,19 @@ Specify the target resource group and resources to move in the body of the reque
414415

415416
## Frequently asked questions
416417

417-
**My resource move operation that usually takes a few minutes is running for almost an hour. Is something wrong?**
418+
### My resource move operation that usually takes a few minutes is running for almost an hour. Is something wrong?
418419

419420
Moving a resource is a complex operation with different phases. It can involve more than just the resource provider of the resource you're trying to move. Azure Resource Manager allows a move operation four hours to finish because of the dependencies between resource providers. This duration gives them time to recover from transient issues. If your move request is within the four-hour period, the operation keeps trying to complete and might succeed. The operation locks the source and destination resource groups during this time to avoid consistency issues.
420421

421-
**Why is my resource group locked for four hours during resource move?**
422+
### Why is my resource group locked for four hours during resource move?
422423

423424
- Move operations are allowed four hours to complete. The operation locks the source and destination resource groups during this time to prevent them from being modified.
424425

425426
- There are two phases in a move request. Resources move during the first phase, and resource providers that depend on the resources being moved are notified during the second phase. A resource group can be locked for all four hours when a resource provider fails either phase. Resource Manager initiates any failed steps during the span of the move operation.
426427

427428
- Resource Manager unlocks both resource groups if a resource doesn't move within four hours. Resources that move successfully are in the destination resource group. Resources that fail to move remain in the source resource group.
428429

429-
**What are the implications of the source and destination resource groups being locked during the resource move?**
430+
### What are the implications of the source and destination resource groups being locked during the resource move?
430431

431432
The lock prevents you from deleting either resource group. The lock also prevents you from creating a new resource, deleting a resource, or updating a resource's properties within each resource group (for example, changing a virtual machine's size).
432433

@@ -440,9 +441,9 @@ In the preceding image, the virtual machine resource belongs to a resource group
440441

441442
Additionally, the source and the destination resource groups can't participate in other move operations simultaneously during a resource move. For example, if you're moving resources from resource group A to resource group B, both resource group A and resource group B can't be involved in another move operation at the same time. You can't simultaneously move resources to or from resource group C. This restriction prevents multiple conflicting operations from locking resource groups during the move process.
442443

443-
**What does the error code "MissingMoveDependentResources" mean?**
444+
### What does the error code "MissingMoveDependentResources" mean?
444445

445-
When you move a resource, its dependent resources must exist in the destination resource group or subscription, or be included in the move request. You get the **MissingMoveDependentResources** error code when a dependent resource doesn't meet this requirement. The error message provides details about the dependent resource that you need to include in the move request.
446+
When you move a resource, its dependent resources must exist in the destination resource group or subscription, or be included in the move request. You get the ### MissingMoveDependentResources** error code when a dependent resource doesn't meet this requirement. The error message provides details about the dependent resource that you need to include in the move request.
446447

447448
For example, moving a virtual machine could require moving seven resource types with three different resource providers. Those resource providers and types are:
448449

@@ -461,29 +462,29 @@ For example, moving a virtual machine could require moving seven resource types
461462

462463
Another common example involves moving a virtual network where you might have to move several other resources associated with that virtual network. The move request could require moving public IP addresses, route tables, virtual network gateways, network security groups, and other resources. A virtual network gateway should be in the same resource group as its virtual network since they can't move separately.
463464

464-
**What does the error code "RequestDisallowedByPolicy" mean?**
465+
### What does the error code "RequestDisallowedByPolicy" mean?
465466

466-
Resource Manager validates your move request before attempting a move. This validation includes checking policies defined for the resources involved in the move. For example, the validation fails when you're attempting to move a key vault but your organization has a policy to deny creating a key vault in the target resource group. The returned error code is **RequestDisallowedByPolicy**.
467+
Resource Manager validates your move request before attempting a move. This validation includes checking policies defined for the resources involved in the move. For example, the validation fails when you're attempting to move a key vault but your organization has a policy to deny creating a key vault in the target resource group. The returned error code is ### RequestDisallowedByPolicy**.
467468

468469
For more information about policies, see [What is Azure Policy?](../../governance/policy/overview.md).
469470

470-
**Why can't I move some resources in Azure?**
471+
### Why can't I move some resources in Azure?
471472

472473
Not all Azure resources allow move operations.
473474

474-
**How many resources can I move in one operation?**
475+
### How many resources can I move in one operation?
475476

476477
Separate large moves into different move operations when possible. Resource Manager immediately returns an error when there are more than 800 resources in a single operation. However, moving fewer than 800 resources can also fail by timing out.
477478

478-
**What is the meaning of the error that a resource isn't in a "succeeded" state?**
479+
### What is the meaning of the error that a resource isn't in a "succeeded" state?
479480

480481
When you get an error message indicating that you can't move a resource because it isn't in a **Succeeded** state, it might be because a dependent resource is blocking the move. Typically, the error code is **MoveCannotProceedWithResourcesNotInSucceededState**.
481482

482483
If the source or target resource group contains a virtual network, the states of all resources that depend on that virtual network are checked during the move. This check includes resources that directly and indirectly depend on the network. The move is blocked if any resources aren't in a succeeded state. For example, if a virtual machine using a virtual network that doesn't report a succeeded state, the move is blocked. The move is blocked even when the virtual machine isn't one of the resources being moved. The move is also blocked even when the virtual machine isn't in the source or destination resource group.
483484

484485
To resolve this issue, move your resources to a resource group that doesn't have a virtual network or [contact support](/azure/azure-portal/supportability/how-to-create-azure-support-request).
485486

486-
**Can I move a resource group to a different subscription?**
487+
### Can I move a resource group to a different subscription?
487488

488489
No, you can't move a resource group to a new subscription. But, you can move all resources in a resource group to a resource group in another subscription. Settings such as tags, role assignments, and policies don't transfer automatically from the original resource group to the destination resource group. You need to apply these settings manually to the new resource group.
489490

0 commit comments

Comments
 (0)