Microsoft.DataProtection backupVaults/backupPolicies

The backupVaults/backupPolicies resource type can be deployed to: Resource groups.

To learn about resource group deployments, see Bicep or ARM template.

Template format

To create a Microsoft.DataProtection/backupVaults/backupPolicies resource, add the following Bicep or JSON to your template.

resource symbolicname 'Microsoft.DataProtection/backupVaults/backupPolicies@2021-06-01-preview' = {
  name: 'string'
  properties: {
    datasourceTypes: [ 'string' ]
    objectType: 'string'
    // For remaining properties, see BaseBackupPolicy objects
  }
}

BaseBackupPolicy objects

Set the objectType property to specify the type of object.

For BackupPolicy, use:

  objectType: 'BackupPolicy'
  policyRules: [
    {
      name: 'string'
      objectType: 'string'
      // For remaining properties, see BasePolicyRule objects
    }
  ]

BasePolicyRule objects

Set the objectType property to specify the type of object.

For AzureBackupRule, use:

  objectType: 'AzureBackupRule'
  backupParameters: {
    objectType: 'string'
    // For remaining properties, see BackupParameters objects
  }
  dataStore: {
    dataStoreType: 'string'
    objectType: 'string'
  }
  trigger: {
    objectType: 'string'
    // For remaining properties, see TriggerContext objects
  }

For AzureRetentionRule, use:

  objectType: 'AzureRetentionRule'
  isDefault: bool
  lifecycles: [
    {
      deleteAfter: {
        duration: 'string'
        objectType: 'string'
        // For remaining properties, see DeleteOption objects
      }
      sourceDataStore: {
        dataStoreType: 'string'
        objectType: 'string'
      }
      targetDataStoreCopySettings: [
        {
          copyAfter: {
            objectType: 'string'
            // For remaining properties, see CopyOption objects
          }
          dataStore: {
            dataStoreType: 'string'
            objectType: 'string'
          }
        }
      ]
    }
  ]

BackupParameters objects

Set the objectType property to specify the type of object.

For AzureBackupParams, use:

  objectType: 'AzureBackupParams'
  backupType: 'string'

TriggerContext objects

Set the objectType property to specify the type of object.

For AdhocBasedTriggerContext, use:

  objectType: 'AdhocBasedTriggerContext'
  taggingCriteria: {
    tagInfo: {
      tagName: 'string'
    }
  }

For ScheduleBasedTriggerContext, use:

  objectType: 'ScheduleBasedTriggerContext'
  schedule: {
    repeatingTimeIntervals: [ 'string' ]
  }
  taggingCriteria: [
    {
      criteria: [
        {
          objectType: 'string'
          // For remaining properties, see BackupCriteria objects
        }
      ]
      isDefault: bool
      taggingPriority: int
      tagInfo: {
        tagName: 'string'
      }
    }
  ]

BackupCriteria objects

Set the objectType property to specify the type of object.

For ScheduleBasedBackupCriteria, use:

  objectType: 'ScheduleBasedBackupCriteria'
  absoluteCriteria: [ 'string' ]
  daysOfMonth: [
    {
      date: int
      isLast: bool
    }
  ]
  daysOfTheWeek: [ 'string' ]
  monthsOfYear: [ 'string' ]
  scheduleTimes: [ 'string' ]
  weeksOfTheMonth: [ 'string' ]

DeleteOption objects

Set the objectType property to specify the type of object.

For AbsoluteDeleteOption, use:

  objectType: 'AbsoluteDeleteOption'

CopyOption objects

Set the objectType property to specify the type of object.

For CopyOnExpiryOption, use:

  objectType: 'CopyOnExpiryOption'

For CustomCopyOption, use:

  objectType: 'CustomCopyOption'
  duration: 'string'

For ImmediateCopyOption, use:

  objectType: 'ImmediateCopyOption'

Property values

backupVaults/backupPolicies

Name Description Value
type The resource type

For Bicep, set this value in the resource declaration.
'Microsoft.DataProtection/backupVaults/backupPolicies'
apiVersion The resource api version

For Bicep, set this value in the resource declaration.
'2021-06-01-preview'
name The resource name

See how to set names and types for child resources in Bicep or JSON ARM templates.
string (required)
properties BackupPolicy base BaseBackupPolicy

BaseBackupPolicy

Name Description Value
datasourceTypes Type of datasource for the backup management string[] (required)
objectType Set the object type BackupPolicy

BackupPolicy

Name Description Value
objectType 'BackupPolicy'
policyRules Policy rule dictionary that contains rules for each backuptype i.e Full/Incremental/Logs etc BasePolicyRule[] (required)

BasePolicyRule

Name Description Value
name string (required)
objectType Set the object type AzureBackupRule
AzureRetentionRule

AzureBackupRule

Name Description Value
objectType 'AzureBackupRule'
backupParameters BackupParameters base BackupParameters
dataStore DataStoreInfo base DataStoreInfoBase (required)
trigger Trigger context TriggerContext (required)

BackupParameters

Name Description Value
objectType Set the object type AzureBackupParams

AzureBackupParams

Name Description Value
objectType Type of the specific object - used for deserializing 'AzureBackupParams'
backupType BackupType ; Full/Incremental etc string (required)

DataStoreInfoBase

Name Description Value
dataStoreType type of datastore; Operational/Vault/Archive 'ArchiveStore'
'OperationalStore'
'VaultStore'
objectType Type of Datasource object, used to initialize the right inherited type string (required)

TriggerContext

Name Description Value
objectType Set the object type AdhocBasedTriggerContext
ScheduleBasedTriggerContext

AdhocBasedTriggerContext

Name Description Value
objectType Type of the specific object - used for deserializing 'AdhocBasedTriggerContext'
taggingCriteria Adhoc backup tagging criteria AdhocBasedTaggingCriteria (required)

AdhocBasedTaggingCriteria

Name Description Value
tagInfo Retention tag RetentionTag

RetentionTag

Name Description Value
tagName Retention Tag Name to relate it to retention rule. string (required)

ScheduleBasedTriggerContext

Name Description Value
objectType Type of the specific object - used for deserializing 'ScheduleBasedTriggerContext'
schedule Schedule for backup BackupSchedule (required)
taggingCriteria List of tags that can be applicable for given schedule. TaggingCriteria[] (required)

BackupSchedule

Name Description Value
repeatingTimeIntervals ISO 8601 repeating time interval format string[] (required)

TaggingCriteria

Name Description Value
criteria Criteria which decides whether the tag can be applied to a triggered backup. BackupCriteria[]
isDefault Specifies if tag is default. bool (required)
taggingPriority Retention Tag priority. int (required)
tagInfo Retention tag RetentionTag (required)

BackupCriteria

Name Description Value
objectType Set the object type ScheduleBasedBackupCriteria

ScheduleBasedBackupCriteria

Name Description Value
objectType Type of the specific object - used for deserializing 'ScheduleBasedBackupCriteria'
absoluteCriteria it contains absolute values like "AllBackup" / "FirstOfDay" / "FirstOfWeek" / "FirstOfMonth"
and should be part of AbsoluteMarker enum
String array containing any of:
'AllBackup'
'FirstOfDay'
'FirstOfMonth'
'FirstOfWeek'
'FirstOfYear'
daysOfMonth This is day of the month from 1 to 28 other wise last of month Day[]
daysOfTheWeek It should be Sunday/Monday/T..../Saturday String array containing any of:
'Friday'
'Monday'
'Saturday'
'Sunday'
'Thursday'
'Tuesday'
'Wednesday'
monthsOfYear It should be January/February/....../December String array containing any of:
'April'
'August'
'December'
'February'
'January'
'July'
'June'
'March'
'May'
'November'
'October'
'September'
scheduleTimes List of schedule times for backup string[]
weeksOfTheMonth It should be First/Second/Third/Fourth/Last String array containing any of:
'First'
'Fourth'
'Last'
'Second'
'Third'

Day

Name Description Value
date Date of the month int
isLast Whether Date is last date of month bool

AzureRetentionRule

Name Description Value
objectType 'AzureRetentionRule'
isDefault bool
lifecycles Array of SourceLifeCycle SourceLifeCycle[] (required)

SourceLifeCycle

Name Description Value
deleteAfter Delete Option DeleteOption (required)
sourceDataStore DataStoreInfo base DataStoreInfoBase (required)
targetDataStoreCopySettings Array of TargetCopySetting TargetCopySetting[]

DeleteOption

Name Description Value
duration Duration of deletion after given timespan string (required)
objectType Set the object type AbsoluteDeleteOption

AbsoluteDeleteOption

Name Description Value
objectType Type of the specific object - used for deserializing 'AbsoluteDeleteOption'

TargetCopySetting

Name Description Value
copyAfter Options to copy CopyOption (required)
dataStore DataStoreInfo base DataStoreInfoBase (required)

CopyOption

Name Description Value
objectType Set the object type CopyOnExpiryOption
CustomCopyOption
ImmediateCopyOption

CopyOnExpiryOption

Name Description Value
objectType Type of the specific object - used for deserializing 'CopyOnExpiryOption'

CustomCopyOption

Name Description Value
objectType Type of the specific object - used for deserializing 'CustomCopyOption'
duration Data copied after given timespan string

ImmediateCopyOption

Name Description Value
objectType Type of the specific object - used for deserializing 'ImmediateCopyOption'

Quickstart templates

The following quickstart templates deploy this resource type.

Template Description
Create Disk & enable protection via Backup Vault

Deploy to Azure
Template that creates a disk and enables protection via Backup Vault
Create Storage Account & enable protection via Backup Vault

Deploy to Azure
Template that creates storage account and enable protection via Backup Vault