az dataprotection backup-policy tag

Note

This reference is part of the dataprotection extension for the Azure CLI (version 2.15.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

az dataprotection backup-policy tag create-absolute-criteria

Create absolute criteria.

az dataprotection backup-policy tag create-generic-criteria

Create generic criteria.

az dataprotection backup-policy tag remove

Remove existing tag from a backup policy.

az dataprotection backup-policy tag set

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

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

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

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.

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.