Share via


az resource-mover move-resource

Note

This reference is part of the resource-mover extension for the Azure CLI (version 2.50.0 or higher). The extension will automatically install the first time you run an az resource-mover move-resource command. Learn more about extensions.

Manage move-resource.

Commands

Name Description Type Status
az resource-mover move-resource add

Create a Move Resource in the move collection.

Extension GA
az resource-mover move-resource delete

Delete a Move Resource from the move collection.

Extension GA
az resource-mover move-resource list

List the Move Resources in the move collection.

Extension GA
az resource-mover move-resource show

Get the Move Resource.

Extension GA
az resource-mover move-resource wait

Place the CLI in a waiting state until a condition is met.

Extension GA

az resource-mover move-resource add

Create a Move Resource in the move collection.

The 'az resource-mover move-resource add' command remains same for both 'RegionToRegion' (default) and 'RegionToZone' type move collections.

az resource-mover move-resource add [--depends-on-overrides]
                                    [--existing-target-id]
                                    [--ids]
                                    [--move-collection-name]
                                    [--move-resource-name]
                                    [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                    [--resource-group]
                                    [--resource-settings]
                                    [--source-id]
                                    [--subscription]

Examples

Add a vNet as a move-resource to the move-collection. (RegionToRegion)

az resource-mover move-resource add --resource-group MyResourceGroup --move-collection-name MyMoveCollection --name MoveResourceName --source-id "/subscriptions/subID/resourceGroups/myRG/providers/Microsoft.Network/virtualNetworks/MyVNet" --resource-settings '{ "resourceType": "Microsoft.Network/virtualNetworks", "targetResourceName": "MyVNet-target" }'

Add a VM as a move-resource to the move-collection. (RegionToZone)

az resource-mover move-resource add --resource-group MyResourceGroup --move-collection-name MyZonalMoveCollection --name MyVMMoveResource --source-id "/subscriptions/subID/resourceGroups/MyResourceGroup/providers/Microsoft.Compute/virtualMachines/MyVM" --resource-settings '{ "resourceType": "Microsoft.Compute/virtualMachines", "targetResourceName": "MyVM", "targetAvailabilityZone": "2", "targetVmSize": "Standard_B2s" }'

Add a VM as a move-resource to the move-collection. (RegionToRegion)

az resource-mover move-resource add --resource-group MyResourceGroup --move-collection-name MyMoveCollection --name MoveResourceName --source-id "/subscriptions/subID/resourceGroups/eastusRG/providers/Microsoft.Compute/virtualMachines/MyVM" --depends-on-overrides id="/subscriptions/subID/resourceGroups/eastusRG/providers/Microsoft.Network/networkInterfaces/MyNIC" target-id="/subscriptions/subID/resourceGroups/westusRG/providers/Microsoft.Network/networkInterfaces/MyNIC" --resource-settings '{ "resourceType": "Microsoft.Compute/virtualMachines", "targetAvailabilitySetId": "/subscriptions/subID/resourceGroups/eastusRG/providers/Microsoft.Compute/availabilitySets/MyAVSet", "targetAvailabilityZone": "2", "targetResourceName": "MyVM-target", "targetVmSize": null, "userManagedIdentities": [/subscriptions/subid/resourceGroups/eastusRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/umi1] }'

Optional Parameters

--depends-on-overrides

Gets or sets the move resource dependencies overrides. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--existing-target-id

Gets or sets the existing target ARM Id of the resource.

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--move-collection-name

The Move Collection Name.

--move-resource-name --name -n

The Move Resource Name.

--no-wait

Do not wait for the long-running operation to finish.

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=.

--resource-settings

The resource settings. Expected value: json-string/@json-file. Support json-file and yaml-file.

--source-id

Gets or sets the Source ARM Id of the resource.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az resource-mover move-resource delete

Delete a Move Resource from the move collection.

The 'az resource-mover move-resource delete' command remains same for both 'RegionToRegion' and 'RegionToZone' type move collections.

az resource-mover move-resource delete [--ids]
                                       [--move-collection-name]
                                       [--move-resource-name]
                                       [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                       [--resource-group]
                                       [--subscription]
                                       [--yes]

Examples

Delete a move-resource from the move-collection.

az resource-mover move-resource delete --move-collection-name MyMoveCollection --name MyMoveResource --resource-group MyResourceGroup

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--move-collection-name

The Move Collection Name.

--move-resource-name --name -n

The Move Resource Name.

--no-wait

Do not wait for the long-running operation to finish.

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--yes -y

Do not prompt for confirmation.

Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az resource-mover move-resource list

List the Move Resources in the move collection.

The 'az resource-mover move-resource list' command remains same for both 'RegionToRegion' and 'RegionToZone' type move collections.

az resource-mover move-resource list --move-collection-name
                                     --resource-group
                                     [--filter]
                                     [--max-items]
                                     [--next-token]

Examples

List the move-resources in a move-collection.

az resource-mover move-resource list --move-collection-name MyMoveCollection --resource-group MyResourceGroup

Required Parameters

--move-collection-name --name -n

The Move Collection Name.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=.

Optional Parameters

--filter

The filter to apply on the operation. For example, you can use $filter=Properties/ProvisioningState eq 'Succeeded'.

--max-items

Total number of items to return in the command's output. If the total number of items available is more than the value specified, a token is provided in the command's output. To resume pagination, provide the token value in --next-token argument of a subsequent command.

--next-token

Token to specify where to start paginating. This is the token value from a previously truncated response.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az resource-mover move-resource show

Get the Move Resource.

The 'az resource-mover move-resource show' command remains same for both 'RegionToRegion' and 'RegionToZone' type move collections.

az resource-mover move-resource show [--ids]
                                     [--move-collection-name]
                                     [--move-resource-name]
                                     [--resource-group]
                                     [--subscription]

Examples

Get the details of a move-resource.

az resource-mover move-resource show --move-collection-name MyMoveCollection --name MyMoveResource --resource-group MyResourceGroup

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--move-collection-name

The Move Collection Name.

--move-resource-name --name -n

The Move Resource Name.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az resource-mover move-resource wait

Place the CLI in a waiting state until a condition is met.

az resource-mover move-resource wait [--created]
                                     [--custom]
                                     [--deleted]
                                     [--exists]
                                     [--ids]
                                     [--interval]
                                     [--move-collection-name]
                                     [--move-resource-name]
                                     [--resource-group]
                                     [--subscription]
                                     [--timeout]
                                     [--updated]

Optional Parameters

--created

Wait until created with 'provisioningState' at 'Succeeded'.

Default value: False
--custom

Wait until the condition satisfies a custom JMESPath query. E.g. provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running'].

--deleted

Wait until deleted.

Default value: False
--exists

Wait until the resource exists.

Default value: False
--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--interval

Polling interval in seconds.

Default value: 30
--move-collection-name

The Move Collection Name.

--move-resource-name --name -n

The Move Resource Name.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--timeout

Maximum wait in seconds.

Default value: 3600
--updated

Wait until updated with provisioningState at 'Succeeded'.

Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.