Share via


az site-recovery protected-item

Note

This reference is part of the site-recovery extension for the Azure CLI (version 2.51.0 or higher). The extension will automatically install the first time you run an az site-recovery protected-item command. Learn more about extensions.

Manage Protected Item.

Commands

Name Description Type Status
az site-recovery protected-item create

Create operation to create an ASR replication protected item (Enable replication).

Extension GA
az site-recovery protected-item delete

Delete operation to delete or purge a replication protected item. This operation will force delete the replication protected item. Use the remove operation on replication protected item to perform a clean disable replication for the item.

Extension GA
az site-recovery protected-item failover-commit

Operation to commit the failover of the replication protected item.

Extension GA
az site-recovery protected-item list

List the list of ASR replication protected items in the protection container.

Extension GA
az site-recovery protected-item planned-failover

Operation to initiate a planned failover of the replication protected item.

Extension GA
az site-recovery protected-item remove

The operation to disable replication on a replication protected item. This will also remove the item.

Extension GA
az site-recovery protected-item reprotect

Operation to reprotect or reverse replicate a failed over replication protected item.

Extension GA
az site-recovery protected-item show

Get the details of an ASR replication protected item.

Extension GA
az site-recovery protected-item unplanned-failover

Operation to initiate a failover of the replication protected item.

Extension GA
az site-recovery protected-item update

Update operation to create an ASR replication protected item (Enable replication).

Extension GA

az site-recovery protected-item create

Create operation to create an ASR replication protected item (Enable replication).

az site-recovery protected-item create --fabric-name
                                       --name
                                       --protection-container
                                       --resource-group
                                       --vault-name
                                       [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                       [--policy-id]
                                       [--protectable-item-id]
                                       [--provider-details]

Examples

protected-item create for A2A

az site-recovery protected-item create -g rg --fabric-name fabric1_name -n protected_item_name --protection-container container1_name --vault-name vault_name --policy-id policy_id --provider-details '{a2a:{fabric-object-id:vm_id,vm-managed-disks:[{disk-id:os_disk,primary-staging-azure-storage-account-id:storage1_id,recovery-resource-group-id:rg_id}],recovery-azure-network-id:vnet2_id,recovery-container-id:container2_id,recovery-resource-group-id:rg_id,recovery-subnet-name:vnet2_subnet}}'

protected-item create for hyper-v-replica-azure

az site-recovery protected-item create -g "rg" --fabric-name "fabric_name" -n "protected_item_name" --protection-container "container_name" --vault-name "vault_name" --policy-id "policy_id" --protectable-item-id "protectable_item_id" --provider-details '{hyper-v-replica-azure:{disks-to-include:["vhd_id"],enable-rdp-on-target-option:Never,os-type:Windows,target-azure-network-id:"vnet_id",target-azure-subnet-id:"subnet_id",target-azure-v2-resource-group-id:"rg_id",target-azure-vm-name:"hypervvm_name",target-storage-account-id:"storage_id",use-managed-disks:false,vhd-id:"vhd_id"}}'

protected-item create for v2arcm

az site-recovery protected-item create -g "rg" --fabric-name "fabric_name" -n "protected_item_name" --protection-container "container_name" --vault-name "vault_name" --policy-id "policy_id" --provider-details '{in-mage-rcm:{fabric-discovery-machine-id:"fabric_discovery_machine_id",process-server-id:"process_server_id",run-as-account-id:"run_as_account_id",target-resource-group-id:"rg_id",target-boot-diagnostics-storage-account-id:"storage_id",target-network-id:"vnet_id",target-subnet-name:MySubnet,target-vm-name:"target_vm_name",disks-default:{disk-type:Premium_LRS,log-storage-account-id:"storage_id"}}}'

Required Parameters

--fabric-name

Name of the fabric.

--name --replicated-protected-item-name -n

A name for the replication protected item.

--protection-container --protection-container-name

Protection container name.

--resource-group -g

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

--vault-name

The name of the recovery services vault.

Optional Parameters

--no-wait

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

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--policy-id

The Policy Id.

--protectable-item-id

The protectable item Id.

--provider-details --provider-specific-details

The ReplicationProviderInput. For HyperVReplicaAzure provider, it will be AzureEnableProtectionInput object. For San provider, it will be SanEnableProtectionInput object. For HyperVReplicaAzure provider, it can be null. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

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 site-recovery protected-item delete

Delete operation to delete or purge a replication protected item. This operation will force delete the replication protected item. Use the remove operation on replication protected item to perform a clean disable replication for the item.

az site-recovery protected-item delete [--fabric-name]
                                       [--ids]
                                       [--name]
                                       [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                       [--protection-container]
                                       [--resource-group]
                                       [--subscription]
                                       [--vault-name]
                                       [--yes]

Examples

protected-item delete

az site-recovery protected-item delete -g rg --fabric-name fabric2_name -n protected_item_name --protection-container container2_name --vault-name vault_name

Optional Parameters

--fabric-name

Fabric name.

--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.

--name --replicated-protected-item-name -n

Replication protected item 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
--protection-container --protection-container-name

Protection container name.

--resource-group -g

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

--subscription

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

--vault-name

The name of the recovery services vault.

--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 site-recovery protected-item failover-commit

Operation to commit the failover of the replication protected item.

az site-recovery protected-item failover-commit [--fabric-name]
                                                [--ids]
                                                [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                                [--protection-container]
                                                [--replicated-protected-item-name]
                                                [--resource-group]
                                                [--subscription]
                                                [--vault-name]

Examples

protected-item failover-commit

az site-recovery protected-item failover-commit --fabric-name fabric1_name --protection-container container1_name -n protected_item_name -g rg --vault-name vault_name

Optional Parameters

--fabric-name

Unique fabric name.

--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.

--no-wait

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

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--protection-container --protection-container-name

Protection container name.

--replicated-protected-item-name -n

Replication protected item name.

--resource-group -g

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

--subscription

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

--vault-name

The name of the recovery services vault.

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 site-recovery protected-item list

List the list of ASR replication protected items in the protection container.

az site-recovery protected-item list --fabric-name
                                     --protection-container
                                     --resource-group
                                     --vault-name
                                     [--max-items]
                                     [--next-token]

Examples

protected-item list

az site-recovery protected-item list -g rg --fabric-name fabric_recovery_name --protection-container container_recovery_name --vault-name vault_name

Required Parameters

--fabric-name

Fabric name.

--protection-container --protection-container-name

Protection container name.

--resource-group -g

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

--vault-name

The name of the recovery services vault.

Optional Parameters

--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 site-recovery protected-item planned-failover

Operation to initiate a planned failover of the replication protected item.

az site-recovery protected-item planned-failover [--fabric-name]
                                                 [--failover-direction]
                                                 [--ids]
                                                 [--name]
                                                 [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                                 [--protection-container]
                                                 [--provider-details]
                                                 [--resource-group]
                                                 [--subscription]
                                                 [--vault-name]

Examples

failback hyper-v-replica-azure

az site-recovery protected-item planned-failover --fabric-name "fabric_name" --protection-container "container_name" -n "protected_item_name" -g "rg" --vault-name "vault_name" --failover-direction RecoveryToPrimary --provider-details '{hyper-v-replica-azure-failback:{data-sync-option:ForSynchronization,recovery-vm-creation-option:NoAction}}'

failback v2arcm

az site-recovery protected-item planned-failover --fabric-name "fabric_name" --protection-container "container_name" -n "protected_item_name" -g "rg" --vault-name "vault_name" --provider-details '{in-mage-rcm-failback:{recovery-point-type:CrashConsistent}}'

Optional Parameters

--fabric-name

Unique fabric name.

--failover-direction

Failover direction.

--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.

--name --replicated-protected-item-name -n

Replication protected item 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
--protection-container --protection-container-name

Protection container name.

--provider-details --provider-specific-details

Provider specific settings. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--resource-group -g

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

--subscription

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

--vault-name

The name of the recovery services vault.

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 site-recovery protected-item remove

The operation to disable replication on a replication protected item. This will also remove the item.

az site-recovery protected-item remove [--disable-protection-reason {MigrationComplete, NotSpecified}]
                                       [--fabric-name]
                                       [--ids]
                                       [--name]
                                       [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                       [--protection-container]
                                       [--provider-input]
                                       [--resource-group]
                                       [--subscription]
                                       [--vault-name]

Examples

protected-item remove

az site-recovery protected-item remove -g rg --fabric-name fabric_recovery_name -n protected_item_name --protection-container container_recovery_name --vault-name vault_name

Optional Parameters

--disable-protection-reason --disable-reason

Disable protection reason. It can have values NotSpecified/MigrationComplete.

Accepted values: MigrationComplete, NotSpecified
--fabric-name

Fabric name.

--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.

--name --replicated-protected-item-name -n

Replication protected item 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
--protection-container --protection-container-name

Protection container name.

--provider-input --replication-provider-input

Replication provider specific input. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--resource-group -g

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

--subscription

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

--vault-name

The name of the recovery services vault.

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 site-recovery protected-item reprotect

Operation to reprotect or reverse replicate a failed over replication protected item.

az site-recovery protected-item reprotect [--fabric-name]
                                          [--failover-direction]
                                          [--ids]
                                          [--name]
                                          [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                          [--protection-container]
                                          [--provider-details]
                                          [--resource-group]
                                          [--subscription]
                                          [--vault-name]

Examples

reprotect for v2arcm after failover

az site-recovery protected-item reprotect --fabric-name "fabric_name" --protection-container "container_name" -n "protected_item_name" -g "rg" --vault-name "vault_name" --failover-direction RecoveryToPrimary --provider-details '{in-mage-rcm:{datastore-name:"datastore_name",log-storage-account-id:"storage_id",reprotect-agent-id:"reprotect_agent_id"}}'

Optional Parameters

--fabric-name

Unique fabric name.

--failover-direction

Failover direction.

--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.

--name --replicated-protected-item-name -n

Replication protected item 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
--protection-container --protection-container-name

Protection container name.

--provider-details --provider-specific-details

Provider specific reverse replication input. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--resource-group -g

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

--subscription

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

--vault-name

The name of the recovery services vault.

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 site-recovery protected-item show

Get the details of an ASR replication protected item.

az site-recovery protected-item show [--fabric-name]
                                     [--ids]
                                     [--name]
                                     [--protection-container]
                                     [--resource-group]
                                     [--subscription]
                                     [--vault-name]

Examples

protected-item show

az site-recovery protected-item show -g rg --fabric-name fabric1_name -n protected_item_name --protection-container container1_name --vault-name vault_name

Optional Parameters

--fabric-name

Fabric unique name.

--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.

--name --replicated-protected-item-name -n

Replication protected item name.

--protection-container --protection-container-name

Protection container name.

--resource-group -g

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

--subscription

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

--vault-name

The name of the recovery services vault.

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 site-recovery protected-item unplanned-failover

Operation to initiate a failover of the replication protected item.

az site-recovery protected-item unplanned-failover [--fabric-name]
                                                   [--failover-direction]
                                                   [--ids]
                                                   [--name]
                                                   [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                                   [--protection-container]
                                                   [--provider-details]
                                                   [--resource-group]
                                                   [--source-site-operations]
                                                   [--subscription]
                                                   [--vault-name]

Examples

protected-item unplanned-failover for A2A

az site-recovery protected-item unplanned-failover --fabric-name fabric1_name --protection-container container1_name -n protected_item_name -g rg --vault-name vault_name --failover-direction PrimaryToRecovery --provider-details '{a2a:{}}' --source-site-operations NotRequired

protected-item failback for A2A

az site-recovery protected-item unplanned-failover --fabric-name fabric2_name --protection-container container2_name -n protected_item_name -g rg --vault-name vault_name --failover-direction PrimaryToRecovery --provider-details '{a2a:{}}' --source-site-operations NotRequired

protected-item failover hyper-v-replica-azure

az site-recovery protected-item unplanned-failover --fabric-name "fabric_name" --protection-container "container_name" -n "protected_item_name" -g "rg" --vault-name "vault_name" --failover-direction PrimaryToRecovery --provider-details '{hyper-v-replica-azure:""}' --source-site-operations NotRequired

protected-item unplanned-failover for v2arcm

az site-recovery protected-item unplanned-failover --fabric-name "fabric_name" --protection-container "container_name" -n "protected_item_name" -g "rg" --vault-name "vault_name" --failover-direction PrimaryToRecovery --provider-details '{in-mage-rcm:{perform-shutdown:true}}' --source-site-operations NotRequired

Optional Parameters

--fabric-name

Unique fabric name.

--failover-direction

Failover direction.

--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.

--name --replicated-protected-item-name -n

Replication protected item 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
--protection-container --protection-container-name

Protection container name.

--provider-details --provider-specific-details

Provider specific settings. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--resource-group -g

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

--source-site-operations

Source site operations status.

--subscription

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

--vault-name

The name of the recovery services vault.

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 site-recovery protected-item update

Update operation to create an ASR replication protected item (Enable replication).

az site-recovery protected-item update [--add]
                                       [--fabric-name]
                                       [--force-string {0, 1, f, false, n, no, t, true, y, yes}]
                                       [--ids]
                                       [--name]
                                       [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                       [--policy-id]
                                       [--protectable-item-id]
                                       [--protection-container]
                                       [--provider-details]
                                       [--remove]
                                       [--resource-group]
                                       [--set]
                                       [--subscription]
                                       [--vault-name]

Examples

protected-item update

az site-recovery protected-item update -g rg --fabric-name fabric1_name -n protected_item_name --protection-container container1_name --vault-name vault_name --policy-id policy_id --provider-details '{a2a:{fabric-object-id:vm_id,vm-managed-disks:[{disk-id:os_disk,primary-staging-azure-storage-account-id:storage1_id,recovery-resource-group-id:rg_id}],recovery-azure-network-id:vnet2_id,recovery-container-id:container2_id,recovery-resource-group-id:rg_id,recovery-subnet-name:vnet2_subnet}}'

Optional Parameters

--add

Add an object to a list of objects by specifying a path and key value pairs. Example: --add property.listProperty <key=value, string or JSON string>.

--fabric-name

Fabric unique name.

--force-string

When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--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.

--name --replicated-protected-item-name -n

Replication protected item 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
--policy-id

The Policy Id.

--protectable-item-id

The protectable item Id.

--protection-container --protection-container-name

Protection container name.

--provider-details --provider-specific-details

The ReplicationProviderInput. For HyperVReplicaAzure provider, it will be AzureEnableProtectionInput object. For San provider, it will be SanEnableProtectionInput object. For HyperVReplicaAzure provider, it can be null. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--remove

Remove a property or an element from a list. Example: --remove property.list <indexToRemove> OR --remove propertyToRemove.

--resource-group -g

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

--set

Update an object by specifying a property path and value to set. Example: --set property1.property2=<value>.

--subscription

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

--vault-name

The name of the recovery services vault.

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.