Backup Policies - Create Or Update
Creates or Updates a backup policy belonging to a backup vault
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupPolicies/{backupPolicyName}?api-version=2025-02-01
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
backup
|
path | True |
string |
Name of the policy |
resource
|
path | True |
string minLength: 1maxLength: 90 |
The name of the resource group. The name is case insensitive. |
subscription
|
path | True |
string (uuid) |
The ID of the target subscription. The value must be an UUID. |
vault
|
path | True |
string |
The name of the backup vault. |
api-version
|
query | True |
string minLength: 1 |
The API version to use for this operation. |
Request Body
Name | Type | Description |
---|---|---|
properties | BaseBackupPolicy: |
BaseBackupPolicy |
Responses
Name | Type | Description |
---|---|---|
200 OK |
OK |
|
Other Status Codes |
Error response describing why the operation failed. |
Security
azure_auth
Azure Active Directory OAuth2 Flow
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name | Description |
---|---|
user_impersonation | impersonate your user account. |
Examples
CreateOrUpdate BackupPolicy
Sample request
PUT https://management.azure.com/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/000pikumar/providers/Microsoft.DataProtection/backupVaults/PrivatePreviewVault/backupPolicies/OSSDBPolicy?api-version=2025-02-01
{
"properties": {
"policyRules": [
{
"backupParameters": {
"backupType": "Full",
"objectType": "AzureBackupParams"
},
"trigger": {
"schedule": {
"repeatingTimeIntervals": [
"R/2019-11-20T08:00:00-08:00/P1W"
]
},
"taggingCriteria": [
{
"tagInfo": {
"tagName": "Default"
},
"taggingPriority": 99,
"isDefault": true
},
{
"tagInfo": {
"tagName": "Weekly"
},
"taggingPriority": 20,
"isDefault": false,
"criteria": [
{
"scheduleTimes": [
"2019-03-01T13:00:00Z"
],
"daysOfTheWeek": [
"Sunday"
],
"objectType": "ScheduleBasedBackupCriteria"
}
]
}
],
"objectType": "ScheduleBasedTriggerContext"
},
"dataStore": {
"dataStoreType": "VaultStore",
"objectType": "DataStoreInfoBase"
},
"name": "BackupWeekly",
"objectType": "AzureBackupRule"
},
{
"lifecycles": [
{
"sourceDataStore": {
"dataStoreType": "VaultStore",
"objectType": "DataStoreInfoBase"
},
"deleteAfter": {
"objectType": "AbsoluteDeleteOption",
"duration": "P1W"
}
}
],
"isDefault": true,
"name": "Default",
"objectType": "AzureRetentionRule"
},
{
"lifecycles": [
{
"sourceDataStore": {
"dataStoreType": "VaultStore",
"objectType": "DataStoreInfoBase"
},
"deleteAfter": {
"objectType": "AbsoluteDeleteOption",
"duration": "P12W"
}
}
],
"isDefault": false,
"name": "Weekly",
"objectType": "AzureRetentionRule"
}
],
"datasourceTypes": [
"OssDB"
],
"objectType": "BackupPolicy"
}
}
Sample response
{
"id": "/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/000pikumar/providers/Microsoft.DataProtection/backupVaults/PrivatePreviewVault/backupPolicies/OSSDBPolicy",
"name": "OSSDBPolicy",
"type": "Microsoft.DataProtection/backupVaults/backupPolicies",
"properties": {
"policyRules": [
{
"backupParameters": {
"backupType": "Full",
"objectType": "AzureBackupParams"
},
"trigger": {
"schedule": {
"repeatingTimeIntervals": [
"R/2019-11-20T08:00:00-08:00/P1W"
]
},
"taggingCriteria": [
{
"tagInfo": {
"tagName": "Default",
"id": "Default_"
},
"taggingPriority": 99,
"isDefault": true
},
{
"tagInfo": {
"tagName": "Weekly",
"id": "Weekly_"
},
"taggingPriority": 20,
"isDefault": false,
"criteria": [
{
"scheduleTimes": [
"2019-03-01T13:00:00Z"
],
"daysOfTheWeek": [
"Sunday"
],
"objectType": "ScheduleBasedBackupCriteria"
}
]
}
],
"objectType": "ScheduleBasedTriggerContext"
},
"dataStore": {
"dataStoreType": "VaultStore",
"objectType": "DataStoreInfoBase"
},
"name": "BackupWeekly",
"objectType": "AzureBackupRule"
},
{
"lifecycles": [
{
"sourceDataStore": {
"dataStoreType": "VaultStore",
"objectType": "DataStoreInfoBase"
},
"deleteAfter": {
"objectType": "AbsoluteDeleteOption",
"duration": "P1W"
}
}
],
"isDefault": true,
"name": "Default",
"objectType": "AzureRetentionRule"
},
{
"lifecycles": [
{
"sourceDataStore": {
"dataStoreType": "VaultStore",
"objectType": "DataStoreInfoBase"
},
"deleteAfter": {
"objectType": "AbsoluteDeleteOption",
"duration": "P12W"
}
}
],
"isDefault": false,
"name": "Weekly",
"objectType": "AzureRetentionRule"
}
],
"datasourceTypes": [
"OssDB"
],
"objectType": "BackupPolicy"
}
}
Definitions
Name | Description |
---|---|
Absolute |
AbsoluteDeleteOption |
Absolute |
it contains absolute values like "AllBackup" / "FirstOfDay" / "FirstOfWeek" / "FirstOfMonth" and should be part of AbsoluteMarker enum |
Adhoc |
AdhocBasedTaggingCriteria |
Adhoc |
AdhocBasedTriggerContext |
Azure |
AzureBackupParams |
Azure |
AzureBackupRule |
Azure |
AzureRetentionRule |
Backup |
BackupPolicy |
Backup |
BackupSchedule |
Base |
BaseBackupPolicyResource |
Cloud |
CloudError |
Copy |
CopyOnExpiryOption |
created |
The type of identity that created the resource. |
Custom |
CustomCopyOption |
Data |
DataStoreInfoBase |
Data |
type of datastore; Operational/Vault/Archive |
Day |
Day |
Day |
It should be Sunday/Monday/T..../Saturday |
Error |
The resource management error response. |
Error |
The resource management error additional info. |
Immediate |
ImmediateCopyOption |
Month |
It should be January/February/....../December |
Retention |
RetentionTag |
Schedule |
ScheduleBasedBackupCriteria |
Schedule |
ScheduleBasedTriggerContext |
Source |
SourceLifeCycle |
system |
Metadata pertaining to creation and last modification of the resource. |
Tagging |
TaggingCriteria |
Target |
TargetCopySetting |
Week |
It should be First/Second/Third/Fourth/Last |
AbsoluteDeleteOption
AbsoluteDeleteOption
Name | Type | Description |
---|---|---|
duration |
string |
Duration of deletion after given timespan |
objectType | string: |
Type of the specific object - used for deserializing |
AbsoluteMarker
it contains absolute values like "AllBackup" / "FirstOfDay" / "FirstOfWeek" / "FirstOfMonth" and should be part of AbsoluteMarker enum
Value | Description |
---|---|
AllBackup | |
FirstOfDay | |
FirstOfMonth | |
FirstOfWeek | |
FirstOfYear |
AdhocBasedTaggingCriteria
AdhocBasedTaggingCriteria
Name | Type | Description |
---|---|---|
tagInfo |
RetentionTag |
AdhocBasedTriggerContext
AdhocBasedTriggerContext
Name | Type | Description |
---|---|---|
objectType | string: |
Type of the specific object - used for deserializing |
taggingCriteria |
AdhocBasedTaggingCriteria |
AzureBackupParams
AzureBackupParams
Name | Type | Description |
---|---|---|
backupType |
string |
BackupType ; Full/Incremental etc |
objectType | string: |
Type of the specific object - used for deserializing |
AzureBackupRule
AzureBackupRule
Name | Type | Description |
---|---|---|
backupParameters | BackupParameters: |
BackupParameters |
dataStore |
DataStoreInfoBase |
|
name |
string |
|
objectType | string: | |
trigger | TriggerContext: |
TriggerContext |
AzureRetentionRule
AzureRetentionRule
Name | Type | Description |
---|---|---|
isDefault |
boolean |
|
lifecycles |
SourceLifeCycle |
|
name |
string |
|
objectType | string: |
BackupPolicy
BackupPolicy
Name | Type | Description |
---|---|---|
datasourceTypes |
string[] |
Type of datasource for the backup management |
objectType | string: | |
policyRules | BasePolicyRule[]: |
Policy rule dictionary that contains rules for each backuptype i.e Full/Incremental/Logs etc |
BackupSchedule
BackupSchedule
Name | Type | Description |
---|---|---|
repeatingTimeIntervals |
string[] |
ISO 8601 repeating time interval format |
timeZone |
string |
Time zone for a schedule. Example: Pacific Standard Time |
BaseBackupPolicyResource
BaseBackupPolicyResource
Name | Type | Description |
---|---|---|
id |
string |
Resource Id represents the complete path to the resource. |
name |
string |
Resource name associated with the resource. |
properties | BaseBackupPolicy: |
BaseBackupPolicy |
systemData |
Metadata pertaining to creation and last modification of the resource. |
|
type |
string |
Resource type represents the complete path of the form Namespace/ResourceType/ResourceType/... |
CloudError
CloudError
Name | Type | Description |
---|---|---|
error |
The resource management error response. |
CopyOnExpiryOption
CopyOnExpiryOption
Name | Type | Description |
---|---|---|
objectType | string: |
Type of the specific object - used for deserializing |
createdByType
The type of identity that created the resource.
Value | Description |
---|---|
Application | |
Key | |
ManagedIdentity | |
User |
CustomCopyOption
CustomCopyOption
Name | Type | Description |
---|---|---|
duration |
string |
Data copied after given timespan |
objectType | string: |
Type of the specific object - used for deserializing |
DataStoreInfoBase
DataStoreInfoBase
Name | Type | Description |
---|---|---|
dataStoreType |
type of datastore; Operational/Vault/Archive |
|
objectType |
string |
Type of Datasource object, used to initialize the right inherited type |
DataStoreTypes
type of datastore; Operational/Vault/Archive
Value | Description |
---|---|
ArchiveStore | |
OperationalStore | |
VaultStore |
Day
Day
Name | Type | Description |
---|---|---|
date |
integer (int32) |
Date of the month |
isLast |
boolean |
Whether Date is last date of month |
DayOfWeek
It should be Sunday/Monday/T..../Saturday
Value | Description |
---|---|
Friday | |
Monday | |
Saturday | |
Sunday | |
Thursday | |
Tuesday | |
Wednesday |
Error
The resource management error response.
Name | Type | Description |
---|---|---|
additionalInfo |
The error additional info. |
|
code |
string |
The error code. |
details |
Error[] |
The error details. |
message |
string |
The error message. |
target |
string |
The error target. |
ErrorAdditionalInfo
The resource management error additional info.
Name | Type | Description |
---|---|---|
info |
object |
The additional info. |
type |
string |
The additional info type. |
ImmediateCopyOption
ImmediateCopyOption
Name | Type | Description |
---|---|---|
objectType | string: |
Type of the specific object - used for deserializing |
Month
It should be January/February/....../December
Value | Description |
---|---|
April | |
August | |
December | |
February | |
January | |
July | |
June | |
March | |
May | |
November | |
October | |
September |
RetentionTag
RetentionTag
Name | Type | Description |
---|---|---|
eTag |
string |
Retention Tag version. |
id |
string |
Retention Tag version. |
tagName |
string |
Retention Tag Name to relate it to retention rule. |
ScheduleBasedBackupCriteria
ScheduleBasedBackupCriteria
Name | Type | Description |
---|---|---|
absoluteCriteria |
it contains absolute values like "AllBackup" / "FirstOfDay" / "FirstOfWeek" / "FirstOfMonth" and should be part of AbsoluteMarker enum |
|
daysOfMonth |
Day[] |
This is day of the month from 1 to 28 other wise last of month |
daysOfTheWeek |
It should be Sunday/Monday/T..../Saturday |
|
monthsOfYear |
Month[] |
It should be January/February/....../December |
objectType | string: |
Type of the specific object - used for deserializing |
scheduleTimes |
string[] (date-time) |
List of schedule times for backup |
weeksOfTheMonth |
It should be First/Second/Third/Fourth/Last |
ScheduleBasedTriggerContext
ScheduleBasedTriggerContext
Name | Type | Description |
---|---|---|
objectType | string: |
Type of the specific object - used for deserializing |
schedule |
BackupSchedule |
|
taggingCriteria |
List of tags that can be applicable for given schedule. |
SourceLifeCycle
SourceLifeCycle
Name | Type | Description |
---|---|---|
deleteAfter | DeleteOption: |
DeleteOption |
sourceDataStore |
DataStoreInfoBase |
|
targetDataStoreCopySettings |
TargetCopySetting |
systemData
Metadata pertaining to creation and last modification of the resource.
Name | Type | Description |
---|---|---|
createdAt |
string (date-time) |
The timestamp of resource creation (UTC). |
createdBy |
string |
The identity that created the resource. |
createdByType |
The type of identity that created the resource. |
|
lastModifiedAt |
string (date-time) |
The timestamp of resource last modification (UTC) |
lastModifiedBy |
string |
The identity that last modified the resource. |
lastModifiedByType |
The type of identity that last modified the resource. |
TaggingCriteria
TaggingCriteria
Name | Type | Description |
---|---|---|
criteria | BackupCriteria[]: |
Criteria which decides whether the tag can be applied to a triggered backup. |
isDefault |
boolean |
Specifies if tag is default. |
tagInfo |
RetentionTag |
|
taggingPriority |
integer (int64) |
Retention Tag priority. |
TargetCopySetting
TargetCopySetting
Name | Type | Description |
---|---|---|
copyAfter | CopyOption: |
CopyOption |
dataStore |
DataStoreInfoBase |
WeekNumber
It should be First/Second/Third/Fourth/Last
Value | Description |
---|---|
First | |
Fourth | |
Last | |
Second | |
Third |