You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Move Azure resources to a new resource group or subscription
13
13
14
-
This article shows you how to move Azure resources to either another Azure subscription or another resource group under the same subscription. You can use the Azure portal, Azure PowerShell, Azure CLI, or the REST API to move resources.
14
+
This article explains how to move Azure resources between resource groups. These resource groups can either be in the same subscription or in different subscriptions. If the move is across subscriptions, then these subscriptions must belong to the same Azure Active Directory (AAD) tenant. You can use Azure portal, Azure PowerShell, Azure CLI, or the REST API to move resources.
15
15
16
-
Both the source group and the target group are locked during the move operation. Write and delete operations are blocked on the resource groups until the move completes. This lock means you can't add, update, or delete resources in the resource groups. It doesn't mean the resources are frozen. For example, if you move an Azure SQL logical server, its databases and other dependent resources to a new resource group or subscription, applications that use the databases experience no downtime. They can still read and write to the databases. The lock can last for a maximum of four hours, but most moves complete in much less time.
16
+
During a move operation, both the source and target resource groups are locked: within each resource group, you can't create a resource, delete a resource, or update a resource’s properties. However, the existing resources stay fully operational. For example, when a virtual machine (VM) is being moved from one resource group to another, the VM can't be deleted and the VM’s properties (for example, VM size) can't be updated. However, the VM itself stays fully operational and services that use it experiences no additional downtime because of the resource move. The lock can last for a maximum of four hours, but most moves are completed in much less time and the lock is removed sooner.
17
17
18
-
If your move requires setting up new dependent resources, you'll experience an interruption in those services until they've been reconfigured.
18
+
Only top-level (parent) resources should be included in the move request. Child resources are moved alongside a parent, but they can't be moved independently. For example, Microsoft.Compute/virtualMachines is a parent resource and can be moved. Its child resource, Microsoft.Compute/virtualMachines/extensions, will be moved alongside the parent. However, the child resource can't be moved by itself.
19
19
20
-
Moving a resource only moves it to a new resource group or subscription. It doesn't change the location of the resource.
20
+
Moving a resource preserves its dependencies with child resources, but its dependencies with other resources may break and need to be reconfigured.
21
+
Moving a resource only changes its resource group, not its physical region.
21
22
22
23
> [!NOTE]
23
24
> Azure resources can't be moved if a read-only lock exists on the source or destination resource group or subscription.
@@ -26,7 +27,7 @@ Moving a resource only moves it to a new resource group or subscription. It does
26
27
27
28
When you move a resource, you change its resource ID. The standard format for a resource ID is `/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}`. When you move a resource to a new resource group or subscription, you change one or more values in that path.
28
29
29
-
If you use the resource ID anywhere, you'll need to change that value. For example, if you have a [custom dashboard](/azure/azure-portal/quickstart-portal-dashboard-azure-cli) in the portal that references a resource ID, you'll need to update that value. Look for any scripts or templates that need to be updated for the new resource ID.
30
+
If you use the resource ID anywhere, you need to change that value. For example, if you have a [custom dashboard](/azure/azure-portal/quickstart-portal-dashboard-azure-cli) in the portal that references a resource ID, you need to update that value. Look for any scripts or templates that need to be updated for the new resource ID.
30
31
31
32
## Checklist before moving resources
32
33
@@ -99,7 +100,7 @@ There are some important steps to do before moving a resource. By verifying thes
99
100
az provider register --namespace Microsoft.Batch
100
101
```
101
102
102
-
1. Before moving the resources, check the subscription quotas for the subscription you're moving the resources to. If moving the resources means the subscription will exceed its limits, you need to review whether you can request an increase in the quota. For a list of 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).
103
+
1. Before moving the resources, check the subscription quotas for the subscription you're moving the resources to. If moving the resources means the subscription exceeds its limits, you need to review whether you can request an increase in the quota. For a list of 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).
103
104
104
105
1. The account moving the resources must have at least the following permissions:
The [validate move operation](/rest/api/resources/resources/validate-move-resources) lets you test your move scenario without actually moving the resources. Use this operation to check if the move will succeed. Validation is automatically called when you send a move request. Use this operation only when you need to predetermine the results. To run this operation, you need the:
346
+
The [validate move operation](/rest/api/resources/resources/validate-move-resources) lets you test your move scenario without actually moving the resources. Use this operation to check if the move succeeds. Validation is automatically called when you send a move request. Use this operation only when you need to predetermine the results. To run this operation, you need the:
346
347
347
348
* Name of the source resource group
348
349
* Resource ID of the target resource group
@@ -426,12 +427,18 @@ If a resource can't be moved within four hours, Resource Manager unlocks both re
426
427
427
428
### What are the implications of the source and destination resource groups being locked during the resource move?
428
429
429
-
The lock prevents you from deleting either resource group, creating a new resource in either resource group, or deleting any of the resources involved in the move.
430
+
The lock prevents you from deleting either resource group. Secondly, within each resource group, the lock prevents you from creating a new resource, deleting a resource, or updating a resource’s properties (for example, changing the size of a VM).
430
431
431
432
The following image shows an error message from the Azure portal when a user tries to delete a resource group that is part of an ongoing move.
432
433
433
434
:::image type="content" source="./media/move-resource-group-and-subscription/move-error-delete.png" alt-text="Screenshot of the Azure portal showing an error message when trying to delete a resource group involved in an ongoing move operation.":::
434
435
436
+
In the following image, the VM resource is part of a resource group (“TestB”) that is going through a move operation. An error message is returned from the Azure portal when a user tries to update a property (VM size) of the VM.
437
+
438
+
:::image type="content" source="./media/move-resource-group-and-subscription/move-error-delete-2.png" alt-text="Screenshot of the Azure portal showing an error message when a user tries to update a property (VM size) of the VM.":::
439
+
440
+
Furthermore, during a resource move, both the source and destination resource groups can't be part of move operations with other resource groups. (for example. If there's an ongoing resource move from resource group A to resource group B, then neither group could partake in move operations with resource group C at the same time.)
441
+
435
442
### What does the error code "MissingMoveDependentResources" mean?
436
443
437
444
When you move a resource, its dependent resources must either 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 has details about the dependent resource that needs to be included in the move request.
@@ -455,7 +462,7 @@ In general, a virtual network gateway must always be in the same resource group
455
462
456
463
### What does the error code "RequestDisallowedByPolicy" mean?
457
464
458
-
Resource Manager validates your move request before attempting the move. This validation includes checking policies defined on the resources involved in the move. For example, if you're attempting to move a key vault but your organization has a policy to deny the creation of a key vault in the target resource group, validation fails and the move is blocked. The returned error code is **RequestDisallowedByPolicy**.
465
+
Resource Manager validates your move request before attempting the move. This validation includes checking policies defined on the resources involved in the move. For example, if you're attempting to move a key vault but your organization has a policy to deny the creation of a key vault in the target resource group, validation fails and the move is blocked. The returned error code is **RequestDisallowedByPolicy**.
459
466
460
467
For more information about policies, see [What is Azure Policy?](../../governance/policy/overview.md).
461
468
@@ -479,10 +486,6 @@ When you receive this error, you have two options. Either move your resources to
479
486
480
487
No, you can't move a resource group to a new subscription. But, you can move all of the resources in the resource group to a resource group in another subscription. Settings such as tags, role assignments, and policies aren't automatically transferred from the original resource group to the destination resource group. You need to reapply these settings to the new resource group. For more information, see [Move resources to new resource group or subscription](./move-support-resources.md).
481
488
482
-
### Unsupported scenarios
483
-
484
-
The platform blocks a scenario where resources from Subscription A are migrated to Subscription B when *at the same time* resources from Subscription B are migrated to Subscription C. This is by design.
485
-
486
489
## Next steps
487
490
488
491
For a list of which resources support move, see [Move operation support for resources](move-support-resources.md).
0 commit comments