Skip to content

Commit ccf8fde

Browse files
Merge pull request #217237 from tfitzmac/1104move
split example
2 parents 1eff2f1 + 97f3dac commit ccf8fde

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

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

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Move resources to a new subscription or resource group
33
description: Use Azure Resource Manager to move resources to a new resource group or subscription.
44
ms.topic: conceptual
5-
ms.date: 08/15/2022
5+
ms.date: 11/04/2022
66
ms.custom: devx-track-azurecli, devx-track-azurepowershell
77
---
88

@@ -219,14 +219,24 @@ If validation fails, you see an error message describing why the resources can't
219219

220220
### Move
221221

222-
To move existing resources to another resource group or subscription, use the [az resource move](/cli/azure/resource#az-resource-move) command. Provide the resource IDs of the resources to move. The following example shows how to move several resources to a new resource group. In the `--ids` parameter, provide a space-separated list of the resource IDs to move.
222+
To move existing resources to another resource group or subscription, use the [az resource move](/cli/azure/resource#az-resource-move) command. In the `--ids` parameter, provide a space-separated list of the resource IDs to move.
223+
224+
The following example shows how to move several resources to a new resource group. It works when using Azure CLI in a **Bash** terminal.
223225

224226
```azurecli
225227
webapp=$(az resource show -g OldRG -n ExampleSite --resource-type "Microsoft.Web/sites" --query id --output tsv)
226228
plan=$(az resource show -g OldRG -n ExamplePlan --resource-type "Microsoft.Web/serverfarms" --query id --output tsv)
227229
az resource move --destination-group newgroup --ids $webapp $plan
228230
```
229231

232+
The next example shows how to run the same commands in a **PowerShell** console.
233+
234+
```azurecli
235+
$webapp=$(az resource show -g OldRG -n ExampleSite --resource-type "Microsoft.Web/sites" --query id --output tsv)
236+
$plan=$(az resource show -g OldRG -n ExamplePlan --resource-type "Microsoft.Web/serverfarms" --query id --output tsv)
237+
az resource move --destination-group newgroup --ids $webapp $plan
238+
```
239+
230240
To move to a new subscription, provide the `--destination-subscription-id` parameter.
231241

232242
## Use REST API
@@ -325,7 +335,7 @@ The following image shows an error message from the Azure portal when a user tri
325335

326336
**Question: What does the error code "MissingMoveDependentResources" mean?**
327337

328-
When moving 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.
338+
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.
329339

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

0 commit comments

Comments
 (0)