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
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.
@@ -164,16 +166,21 @@ When the move has completed, you're notified of the result.
164
166
165
167
### Validate
166
168
167
-
To test your move scenario without actually moving the resources, use the [Invoke-AzResourceAction](/powershell/module/az.resources/invoke-azresourceaction) command. Use this command only when you need to predetermine the results. To run this operation, you need the:
168
-
169
-
* Resource ID of the source resource group
170
-
* Resource ID of the target resource group
171
-
* Resource ID of each resource to move
169
+
To test your move scenario without actually moving the resources, use the [Invoke-AzResourceAction](/powershell/module/az.resources/invoke-azresourceaction) command. Use this command only when you need to predetermine the results.
@@ -185,9 +192,13 @@ If validation fails, you see an error message describing why the resources can't
185
192
To move existing resources to another resource group or subscription, use the [Move-AzResource](/powershell/module/az.resources/move-azresource) command. The following example shows how to move several resources to a new resource group.
To move to a new subscription, provide the `--destination-subscription-id` parameter.
242
253
254
+
## Use Python
255
+
256
+
### Validate
257
+
258
+
To test your move scenario without actually moving the resources, use the [ResourceManagementClient.resources.begin_validate_move_resources](/python/api/azure-mgmt-resource/azure.mgmt.resource.resources.v2022_09_01.operations.resourcesoperations#azure-mgmt-resource-resources-v2022-09-01-operations-resourcesoperations-begin-validate-move-resources) method. Use this method only when you need to predetermine the results.
259
+
260
+
```python
261
+
import os
262
+
from azure.identity import AzureCliCredential
263
+
from azure.mgmt.resource import ResourceManagementClient
If validation fails, you see an error message describing why the resources can't be moved.
297
+
298
+
### Move
299
+
300
+
To move existing resources to another resource group or subscription, use the [ResourceManagementClient.resources.begin_move_resources](/python/api/azure-mgmt-resource/azure.mgmt.resource.resources.v2022_09_01.operations.resourcesoperations#azure-mgmt-resource-resources-v2022-09-01-operations-resourcesoperations-begin-move-resources) method. The following example shows how to move several resources to a new resource group.
301
+
302
+
```python
303
+
import os
304
+
from azure.identity import AzureCliCredential
305
+
from azure.mgmt.resource import ResourceManagementClient
0 commit comments