Share via


az dataprotection backup-policy tag

Note

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

Create criterias and add or remove tag in policy.

Commands

Name Description Type Status
az dataprotection backup-policy tag create-absolute-criteria

Create absolute criteria.

Extension GA
az dataprotection backup-policy tag create-generic-criteria

Create generic criteria.

Extension GA
az dataprotection backup-policy tag remove

Remove existing tag from a backup policy.

Extension GA
az dataprotection backup-policy tag set

Add new tag or update existing tag of a backup policy.

Extension GA

az dataprotection backup-policy tag create-absolute-criteria

Create absolute criteria.

az dataprotection backup-policy tag create-absolute-criteria --absolute-criteria {AllBackup, FirstOfDay, FirstOfMonth, FirstOfWeek, FirstOfYear}

Examples

create absolute criteria

az dataprotection backup-policy tag create-absolute-criteria --absolute-criteria FirstOfDay

Required Parameters

--absolute-criteria

Specify retention criteria.

Accepted values: AllBackup, FirstOfDay, FirstOfMonth, FirstOfWeek, FirstOfYear
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 tag create-generic-criteria

Create generic criteria.

az dataprotection backup-policy tag create-generic-criteria [--days-of-month]
                                                            [--days-of-week {Friday, Monday, Saturday, Sunday, Thursday, Tuesday, Wednesday}]
                                                            [--months-of-year {April, August, December, February, January, July, June, March, May, November, October, September}]
                                                            [--weeks-of-month {First, Fourth, Last, Second, Third}]

Examples

Create generic criteria

az dataprotection backup-policy tag create-generic-criteria --days-of-week Sunday Monday

Optional Parameters

--days-of-month

Specify days of month. Allowed values are 1 to 28 and Last.

--days-of-week

Specify days of week.

Accepted values: Friday, Monday, Saturday, Sunday, Thursday, Tuesday, Wednesday
--months-of-year

Specify months of year.

Accepted values: April, August, December, February, January, July, June, March, May, November, October, September
--weeks-of-month

Specify weeks of month.

Accepted values: First, Fourth, Last, Second, Third
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 tag remove

Remove existing tag from a backup policy.

az dataprotection backup-policy tag remove --name {Daily, Monthly, Weekly, Yearly}
                                           --policy

Examples

Remove daily tag.

az dataprotection backup-policy tag remove --name Daily --policy policy.json

Required Parameters

--name

Specify the tag name to be removed in policy.

Accepted values: Daily, 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 tag set

Add new tag or update existing tag of a backup policy.

az dataprotection backup-policy tag set --criteria
                                        --name {Daily, Monthly, Weekly, Yearly}
                                        --policy

Examples

Add tag for daily retention in a backup policy.

az dataprotection backup-policy tag set --criteria criteria.json --name Daily --policy policy.json

Required Parameters

--criteria

Crtierias to be associated with the tag. Specify space separated json file names.

--name

Specify the tag name to be edited in policy.

Accepted values: Daily, 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.