Share via


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-09-01

URI Parameters

Name In Required Type Description
backupPolicyName
path True

string

resourceGroupName
path True

string

minLength: 1
maxLength: 90

The name of the resource group. The name is case insensitive.

subscriptionId
path True

string (uuid)

The ID of the target subscription. The value must be an UUID.

vaultName
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:

BackupPolicy

BaseBackupPolicyResource properties

Responses

Name Type Description
200 OK

BaseBackupPolicyResource

Resource 'BaseBackupPolicyResource' update operation succeeded

Other Status Codes

CloudError

An unexpected error response.

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-09-01

{
  "properties": {
    "datasourceTypes": [
      "OssDB"
    ],
    "objectType": "BackupPolicy",
    "policyRules": [
      {
        "name": "BackupWeekly",
        "backupParameters": {
          "backupType": "Full",
          "objectType": "AzureBackupParams"
        },
        "dataStore": {
          "dataStoreType": "VaultStore",
          "objectType": "DataStoreInfoBase"
        },
        "objectType": "AzureBackupRule",
        "trigger": {
          "objectType": "ScheduleBasedTriggerContext",
          "schedule": {
            "repeatingTimeIntervals": [
              "R/2019-11-20T08:00:00-08:00/P1W"
            ]
          },
          "taggingCriteria": [
            {
              "isDefault": true,
              "tagInfo": {
                "tagName": "Default"
              },
              "taggingPriority": 99
            },
            {
              "criteria": [
                {
                  "daysOfTheWeek": [
                    "Sunday"
                  ],
                  "objectType": "ScheduleBasedBackupCriteria",
                  "scheduleTimes": [
                    "2019-03-01T13:00:00Z"
                  ]
                }
              ],
              "isDefault": false,
              "tagInfo": {
                "tagName": "Weekly"
              },
              "taggingPriority": 20
            }
          ]
        }
      },
      {
        "name": "Default",
        "isDefault": true,
        "lifecycles": [
          {
            "deleteAfter": {
              "duration": "P1W",
              "objectType": "AbsoluteDeleteOption"
            },
            "sourceDataStore": {
              "dataStoreType": "VaultStore",
              "objectType": "DataStoreInfoBase"
            }
          }
        ],
        "objectType": "AzureRetentionRule"
      },
      {
        "name": "Weekly",
        "isDefault": false,
        "lifecycles": [
          {
            "deleteAfter": {
              "duration": "P12W",
              "objectType": "AbsoluteDeleteOption"
            },
            "sourceDataStore": {
              "dataStoreType": "VaultStore",
              "objectType": "DataStoreInfoBase"
            }
          }
        ],
        "objectType": "AzureRetentionRule"
      }
    ]
  }
}

Sample response

{
  "name": "OSSDBPolicy",
  "type": "Microsoft.DataProtection/backupVaults/backupPolicies",
  "id": "/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/000pikumar/providers/Microsoft.DataProtection/backupVaults/PrivatePreviewVault/backupPolicies/OSSDBPolicy",
  "properties": {
    "datasourceTypes": [
      "OssDB"
    ],
    "objectType": "BackupPolicy",
    "policyRules": [
      {
        "name": "BackupWeekly",
        "backupParameters": {
          "backupType": "Full",
          "objectType": "AzureBackupParams"
        },
        "dataStore": {
          "dataStoreType": "VaultStore",
          "objectType": "DataStoreInfoBase"
        },
        "objectType": "AzureBackupRule",
        "trigger": {
          "objectType": "ScheduleBasedTriggerContext",
          "schedule": {
            "repeatingTimeIntervals": [
              "R/2019-11-20T08:00:00-08:00/P1W"
            ]
          },
          "taggingCriteria": [
            {
              "isDefault": true,
              "tagInfo": {
                "id": "Default_",
                "tagName": "Default"
              },
              "taggingPriority": 99
            },
            {
              "criteria": [
                {
                  "daysOfTheWeek": [
                    "Sunday"
                  ],
                  "objectType": "ScheduleBasedBackupCriteria",
                  "scheduleTimes": [
                    "2019-03-01T13:00:00Z"
                  ]
                }
              ],
              "isDefault": false,
              "tagInfo": {
                "id": "Weekly_",
                "tagName": "Weekly"
              },
              "taggingPriority": 20
            }
          ]
        }
      },
      {
        "name": "Default",
        "isDefault": true,
        "lifecycles": [
          {
            "deleteAfter": {
              "duration": "P1W",
              "objectType": "AbsoluteDeleteOption"
            },
            "sourceDataStore": {
              "dataStoreType": "VaultStore",
              "objectType": "DataStoreInfoBase"
            }
          }
        ],
        "objectType": "AzureRetentionRule"
      },
      {
        "name": "Weekly",
        "isDefault": false,
        "lifecycles": [
          {
            "deleteAfter": {
              "duration": "P12W",
              "objectType": "AbsoluteDeleteOption"
            },
            "sourceDataStore": {
              "dataStoreType": "VaultStore",
              "objectType": "DataStoreInfoBase"
            }
          }
        ],
        "objectType": "AzureRetentionRule"
      }
    ]
  }
}

Definitions

Name Description
AbsoluteDeleteOption

Delete option with duration

AbsoluteMarker
AdhocBasedTaggingCriteria

Adhoc backup tagging criteria

AdhocBasedTriggerContext

Adhoc trigger context

AzureBackupParams

Azure backup parameters

AzureBackupRule

Azure backup rule

AzureRetentionRule

Azure retention rule

BackupPolicy

Rule based backup policy

BackupSchedule

Schedule for backup

BaseBackupPolicyResource

BaseBackupPolicy resource

CloudError

An error response from Azure Backup.

CopyOnExpiryOption

Copy on Expiry Option

createdByType

The type of identity that created the resource.

CustomCopyOption

Duration based custom options to copy

DataStoreInfoBase

DataStoreInfo base

DataStoreTypes

type of datastore; Operational/Vault/Archive

Day

Day of the week

DayOfWeek
Error

The resource management error response.

ErrorAdditionalInfo

The resource management error additional info.

ImmediateCopyOption

Immediate copy Option

Month
RetentionTag

Retention tag

ScheduleBasedBackupCriteria

Schedule based backup criteria

ScheduleBasedTriggerContext

Schedule based trigger context

SourceLifeCycle

Source LifeCycle

systemData

Metadata pertaining to creation and last modification of the resource.

TaggingCriteria

Tagging criteria

TargetCopySetting

Target copy settings

WeekNumber

AbsoluteDeleteOption

Delete option with duration

Name Type Description
duration

string

Duration of deletion after given timespan

objectType string:

AbsoluteDeleteOption

Type of the specific object - used for deserializing

AbsoluteMarker

Value Description
AllBackup
FirstOfDay
FirstOfMonth
FirstOfWeek
FirstOfYear

AdhocBasedTaggingCriteria

Adhoc backup tagging criteria

Name Type Description
tagInfo

RetentionTag

Retention tag information

AdhocBasedTriggerContext

Adhoc trigger context

Name Type Description
objectType string:

AdhocBasedTriggerContext

Type of the specific object - used for deserializing

taggingCriteria

AdhocBasedTaggingCriteria

Tagging Criteria containing retention tag for adhoc backup.

AzureBackupParams

Azure backup parameters

Name Type Description
backupType

string

BackupType ; Full/Incremental etc

objectType string:

AzureBackupParams

Type of the specific object - used for deserializing

AzureBackupRule

Azure backup rule

Name Type Description
backupParameters BackupParameters:

AzureBackupParams

BackupParameters base

dataStore

DataStoreInfoBase

DataStoreInfo base

name

string

objectType string:

AzureBackupRule

trigger TriggerContext:

Trigger context

AzureRetentionRule

Azure retention rule

Name Type Description
isDefault

boolean

lifecycles

SourceLifeCycle[]

Source LifeCycle

name

string

objectType string:

AzureRetentionRule

BackupPolicy

Rule based backup policy

Name Type Description
datasourceTypes

string[]

Type of datasource for the backup management

objectType string:

BackupPolicy

policyRules BasePolicyRule[]:

Policy rule dictionary that contains rules for each backuptype i.e Full/Incremental/Logs etc

BackupSchedule

Schedule for backup

Name Type Description
repeatingTimeIntervals

string[]

Repeating time interval which only support the following ISO 8601 format [R/startDateTime/Duration]. Example: R/2007-03-01T13:00:00Z/P1Y2M10DT2H30M

timeZone

string

Time zone for a schedule. Example: Pacific Standard Time

BaseBackupPolicyResource

BaseBackupPolicy resource

Name Type Description
id

string (arm-id)

Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"

name

string

The name of the resource

properties BaseBackupPolicy:

BackupPolicy

BaseBackupPolicyResource properties

systemData

systemData

Azure Resource Manager metadata containing createdBy and modifiedBy information.

type

string

The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

CloudError

An error response from Azure Backup.

Name Type Description
error

Error

The resource management error response.

CopyOnExpiryOption

Copy on Expiry Option

Name Type Description
objectType string:

CopyOnExpiryOption

Type of the specific object - used for deserializing

createdByType

The type of identity that created the resource.

Value Description
User
Application
ManagedIdentity
Key

CustomCopyOption

Duration based custom options to copy

Name Type Description
duration

string

Data copied after given timespan

objectType string:

CustomCopyOption

Type of the specific object - used for deserializing

DataStoreInfoBase

DataStoreInfo base

Name Type Description
dataStoreType

DataStoreTypes

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
OperationalStore
VaultStore
ArchiveStore

Day

Day of the week

Name Type Description
date

integer (int32)

Date of the month

isLast

boolean

Whether Date is last date of month

DayOfWeek

Value Description
Friday
Monday
Saturday
Sunday
Thursday
Tuesday
Wednesday

Error

The resource management error response.

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

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

Immediate copy Option

Name Type Description
objectType string:

ImmediateCopyOption

Type of the specific object - used for deserializing

Month

Value Description
April
August
December
February
January
July
June
March
May
November
October
September

RetentionTag

Retention tag

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

Schedule based backup criteria

Name Type Description
absoluteCriteria

AbsoluteMarker[]

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

DayOfWeek[]

It should be Sunday/Monday/T..../Saturday

monthsOfYear

Month[]

It should be January/February/....../December

objectType string:

ScheduleBasedBackupCriteria

Type of the specific object - used for deserializing

scheduleTimes

string[] (date-time)

List of schedule times for backup

weeksOfTheMonth

WeekNumber[]

It should be First/Second/Third/Fourth/Last

ScheduleBasedTriggerContext

Schedule based trigger context

Name Type Description
objectType string:

ScheduleBasedTriggerContext

Type of the specific object - used for deserializing

schedule

BackupSchedule

Schedule for this backup

taggingCriteria

TaggingCriteria[]

List of tags that can be applicable for given schedule.

SourceLifeCycle

Source LifeCycle

Name Type Description
deleteAfter DeleteOption:

AbsoluteDeleteOption

Delete Option

sourceDataStore

DataStoreInfoBase

DataStoreInfo base

targetDataStoreCopySettings

TargetCopySetting[]

Target copy settings

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

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

createdByType

The type of identity that last modified the resource.

TaggingCriteria

Tagging criteria

Name Type Description
criteria BackupCriteria[]:

ScheduleBasedBackupCriteria[]

Criteria which decides whether the tag can be applied to a triggered backup.

isDefault

boolean

Specifies if tag is default.

tagInfo

RetentionTag

Retention tag information

taggingPriority

integer (int64)

Retention Tag priority.

TargetCopySetting

Target copy settings

Name Type Description
copyAfter CopyOption:

It can be CustomCopyOption or ImmediateCopyOption.

dataStore

DataStoreInfoBase

Info of target datastore

WeekNumber

Value Description
First
Fourth
Last
Second
Third