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
Name of the fabric.
A name for the replication protected item.
Protection container name.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
The name of the recovery services vault.
Optional Parameters
Do not wait for the long-running operation to finish.
The Policy Id.
The protectable item Id.
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
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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.
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.
Replication protected item name.
Do not wait for the long-running operation to finish.
Protection container name.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
The name of the recovery services vault.
Do not prompt for confirmation.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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
Unique fabric name.
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.
Do not wait for the long-running operation to finish.
Protection container name.
Replication protected item name.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
The name of the recovery services vault.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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.
Protection container name.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
The name of the recovery services vault.
Optional Parameters
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.
Token to specify where to start paginating. This is the token value from a previously truncated response.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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
Unique fabric name.
Failover direction.
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.
Replication protected item name.
Do not wait for the long-running operation to finish.
Protection container name.
Provider specific settings. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
The name of the recovery services vault.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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. It can have values NotSpecified/MigrationComplete.
Fabric name.
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.
Replication protected item name.
Do not wait for the long-running operation to finish.
Protection container name.
Replication provider specific input. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
The name of the recovery services vault.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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
Unique fabric name.
Failover direction.
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.
Replication protected item name.
Do not wait for the long-running operation to finish.
Protection container name.
Provider specific reverse replication input. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
The name of the recovery services vault.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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 unique name.
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.
Replication protected item name.
Protection container name.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
The name of the recovery services vault.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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
Unique fabric name.
Failover direction.
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.
Replication protected item name.
Do not wait for the long-running operation to finish.
Protection container name.
Provider specific settings. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Source site operations status.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
The name of the recovery services vault.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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 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 unique name.
When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.
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.
Replication protected item name.
Do not wait for the long-running operation to finish.
The Policy Id.
The protectable item Id.
Protection container name.
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 a property or an element from a list. Example: --remove property.list <indexToRemove>
OR --remove propertyToRemove
.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Update an object by specifying a property path and value to set. Example: --set property1.property2=<value>
.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
The name of the recovery services vault.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.