az dataprotection backup-policy retention-rule

Note

This reference is part of the dataprotection extension for the Azure CLI (version 2.51.0 or higher). The extension will automatically install the first time you run an az dataprotection backup-policy retention-rule command. Learn more about extensions.

Command group 'az dataprotection' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Create lifecycles and add or remove retention rules in a backup policy.

Commands

Name Description Type Status
az dataprotection backup-policy retention-rule create-lifecycle

Create lifecycle for Azure Retention rule.

Extension Experimental
az dataprotection backup-policy retention-rule remove

Remove existing retention rule in a backup policy.

Extension Experimental
az dataprotection backup-policy retention-rule set

Add new retention rule or update existing retention rule.

Extension Experimental

az dataprotection backup-policy retention-rule create-lifecycle

Experimental

Command group 'az dataprotection' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Create lifecycle for Azure Retention rule.

az dataprotection backup-policy retention-rule create-lifecycle --count
                                                                --retention-duration-type {Days, Months, Weeks, Years}
                                                                --source-datastore {ArchiveStore, OperationalStore, VaultStore}
                                                                [--copy-option {CopyOnExpiryOption, CustomCopyOption, ImmediateCopyOption}]
                                                                [--target-datastore {ArchiveStore, OperationalStore, VaultStore}]

Examples

create daily lifecycle

az dataprotection backup-policy retention-rule create-lifecycle --retention-duration-count 12 --retention-duration-type Days --source-datastore OperationalStore

Required Parameters

--count --retention-duration-count

Retention duration count.

--retention-duration-type --type

Retention duration type.

accepted values: Days, Months, Weeks, Years
--source-datastore

Specify source datastore.

accepted values: ArchiveStore, OperationalStore, VaultStore

Optional Parameters

--copy-option

Specify copy option from source datastore to target datastore.

accepted values: CopyOnExpiryOption, CustomCopyOption, ImmediateCopyOption
--target-datastore

Specify target datastore.

accepted values: ArchiveStore, OperationalStore, VaultStore
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 dataprotection backup-policy retention-rule remove

Experimental

Command group 'az dataprotection' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Remove existing retention rule in a backup policy.

az dataprotection backup-policy retention-rule remove --name {Daily, Default, Monthly, Weekly, Yearly}
                                                      --policy

Examples

Remove retention rule

az dataprotection backup-policy retention-rule remove --name Daily --policy policy.json

Required Parameters

--name

Specify the retention rule name to be removed in policy.

accepted values: Daily, Default, Monthly, Weekly, Yearly
--policy

Existing policy Json string or file.

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 dataprotection backup-policy retention-rule set

Experimental

Command group 'az dataprotection' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Add new retention rule or update existing retention rule.

az dataprotection backup-policy retention-rule set --lifecycles
                                                   --name {Daily, Default, Monthly, Weekly, Yearly}
                                                   --policy

Examples

Add daily retention rule

az dataprotection backup-policy retention-rule set --lifecycles dailylifecycle.json --name Daily --policy policy.json

Required Parameters

--lifecycles

Lifecycles to be associated with the retention rule. Specify space separated json file names.

--name

Specify the retention rule name to be edited in policy.

accepted values: Daily, Default, Monthly, Weekly, Yearly
--policy

Policy Json string or file.

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.