Share via


az site-recovery policy

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 policy command. Learn more about extensions.

Manage the replication policies for a vault.

Commands

Name Description Type Status
az site-recovery policy create

Create operation to create a replication policy.

Extension GA
az site-recovery policy delete

Delete operation to delete a replication policy.

Extension GA
az site-recovery policy list

List the replication policies for a vault.

Extension GA
az site-recovery policy show

Get the details of a replication policy.

Extension GA
az site-recovery policy update

Update operation to update a replication policy.

Extension GA

az site-recovery policy create

Create operation to create a replication policy.

az site-recovery policy create --name
                               --resource-group
                               --vault-name
                               [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                               [--provider-input]

Examples

policy create of type in-mage-rcm

az site-recovery policy create -g "rg" --vault-name "vault_name" -n "policy_name" --provider-specific-input '{in-mage-rcm:{app-consistent-frequency-in-minutes:0,crash-consistent-frequency-in-minutes:5,enable-multi-vm-sync:true,recovery-point-history-in-minutes:1440}}'

policy create for type in-mage-rcm-failback

az site-recovery policy create -g rg --vault-name vault_name -n policy_name_rcm_failback --provider-specific-input '{in-mage-rcm-failback:{app-consistent-frequency-in-minutes:60,crash-consistent-frequency-in-minutes:5}}'

policy create for A2A

az site-recovery policy create -g rg --vault-name vault_name -n policy_name --provider-specific-input {a2a:{multi-vm-sync-status:Enable}}

policy create for hyper-v-replica-azure

az site-recovery policy create -g "rg" --vault-name "vault_name" -n "policy_name" --provider-specific-input '{hyper-v-replica-azure:{application-consistent-snapshot-frequency-in-hours:1,recovery-point-history-duration:2,replication-interval:300}}'

Required Parameters

--name --policy-name -n

Replication policy 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
--provider-input --provider-specific-input

The ReplicationProviderSettings. 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 policy delete

Delete operation to delete a replication policy.

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

Examples

policy delete

az site-recovery policy delete -g rg --vault-name vault_name -n policy_name_rcm

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.

--name --policy-name -n

Replication policy 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=<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 policy list

List the replication policies for a vault.

az site-recovery policy list --resource-group
                             --vault-name
                             [--max-items]
                             [--next-token]

Examples

policy list

az site-recovery policy list -g rg --vault-name vault_name

Required Parameters

--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 policy show

Get the details of a replication policy.

az site-recovery policy show [--ids]
                             [--name]
                             [--resource-group]
                             [--subscription]
                             [--vault-name]

Examples

policy show

az site-recovery policy show -g rg --vault-name vault_name -n policy_name_rcm

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.

--name --policy-name -n

Replication policy 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 policy update

Update operation to update a replication policy.

az site-recovery policy update [--ids]
                               [--name]
                               [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                               [--provider-input]
                               [--resource-group]
                               [--subscription]
                               [--vault-name]

Examples

policy update for type in-mage-rcm

az site-recovery policy update -g rg --vault-name vault_name -n policy_name_rcm --provider-specific-input '{in-mage-rcm:{app-consistent-frequency-in-minutes:0,crash-consistent-frequency-in-minutes:5,enable-multi-vm-sync:true,recovery-point-history-in-minutes:1440}}'

policy update for type in-mage-rcm-failback

az site-recovery policy update -g rg --vault-name vault_name -n policy_name_rcm_failback --provider-specific-input '{in-mage-rcm-failback:{app-consistent-frequency-in-minutes:0,crash-consistent-frequency-in-minutes:10}}'

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.

--name --policy-name -n

Policy Id.

--no-wait

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

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--provider-input --provider-specific-input

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