Microsoft.RecoveryServices vaults/backupPolicies 2021-02-01

The vaults/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.RecoveryServices/vaults/backupPolicies resource, add the following Bicep or JSON to your template.

resource symbolicname 'Microsoft.RecoveryServices/vaults/backupPolicies@2021-02-01' = {
  name: 'string'
  location: 'string'
  tags: {
    tagName1: 'tagValue1'
    tagName2: 'tagValue2'
  }
  parent: parentSymbolicName
  eTag: 'string'
  properties: {
    protectedItemsCount: int
    backupManagementType: 'string'
    // For remaining properties, see ProtectionPolicy objects
  }
}

ProtectionPolicy objects

Set the backupManagementType property to specify the type of object.

For AzureIaasVM, use:

  backupManagementType: 'AzureIaasVM'
  instantRPDetails: {
    azureBackupRGNamePrefix: 'string'
    azureBackupRGNameSuffix: 'string'
  }
  instantRpRetentionRangeInDays: int
  retentionPolicy: {
    retentionPolicyType: 'string'
    // For remaining properties, see RetentionPolicy objects
  }
  schedulePolicy: {
    schedulePolicyType: 'string'
    // For remaining properties, see SchedulePolicy objects
  }
  timeZone: 'string'

For AzureSql, use:

  backupManagementType: 'AzureSql'
  retentionPolicy: {
    retentionPolicyType: 'string'
    // For remaining properties, see RetentionPolicy objects
  }

For AzureStorage, use:

  backupManagementType: 'AzureStorage'
  retentionPolicy: {
    retentionPolicyType: 'string'
    // For remaining properties, see RetentionPolicy objects
  }
  schedulePolicy: {
    schedulePolicyType: 'string'
    // For remaining properties, see SchedulePolicy objects
  }
  timeZone: 'string'
  workLoadType: 'string'

For AzureWorkload, use:

  backupManagementType: 'AzureWorkload'
  makePolicyConsistent: bool
  settings: {
    isCompression: bool
    issqlcompression: bool
    timeZone: 'string'
  }
  subProtectionPolicy: [
    {
      policyType: 'string'
      retentionPolicy: {
        retentionPolicyType: 'string'
        // For remaining properties, see RetentionPolicy objects
      }
      schedulePolicy: {
        schedulePolicyType: 'string'
        // For remaining properties, see SchedulePolicy objects
      }
    }
  ]
  workLoadType: 'string'

For GenericProtectionPolicy, use:

  backupManagementType: 'GenericProtectionPolicy'
  fabricName: 'string'
  subProtectionPolicy: [
    {
      policyType: 'string'
      retentionPolicy: {
        retentionPolicyType: 'string'
        // For remaining properties, see RetentionPolicy objects
      }
      schedulePolicy: {
        schedulePolicyType: 'string'
        // For remaining properties, see SchedulePolicy objects
      }
    }
  ]
  timeZone: 'string'

For MAB, use:

  backupManagementType: 'MAB'
  retentionPolicy: {
    retentionPolicyType: 'string'
    // For remaining properties, see RetentionPolicy objects
  }
  schedulePolicy: {
    schedulePolicyType: 'string'
    // For remaining properties, see SchedulePolicy objects
  }

RetentionPolicy objects

Set the retentionPolicyType property to specify the type of object.

For LongTermRetentionPolicy, use:

  retentionPolicyType: 'LongTermRetentionPolicy'
  dailySchedule: {
    retentionDuration: {
      count: int
      durationType: 'string'
    }
    retentionTimes: [ 'string' ]
  }
  monthlySchedule: {
    retentionDuration: {
      count: int
      durationType: 'string'
    }
    retentionScheduleDaily: {
      daysOfTheMonth: [
        {
          date: int
          isLast: bool
        }
      ]
    }
    retentionScheduleFormatType: 'string'
    retentionScheduleWeekly: {
      daysOfTheWeek: [ 'string' ]
      weeksOfTheMonth: [ 'string' ]
    }
    retentionTimes: [ 'string' ]
  }
  weeklySchedule: {
    daysOfTheWeek: [ 'string' ]
    retentionDuration: {
      count: int
      durationType: 'string'
    }
    retentionTimes: [ 'string' ]
  }
  yearlySchedule: {
    monthsOfYear: [ 'string' ]
    retentionDuration: {
      count: int
      durationType: 'string'
    }
    retentionScheduleDaily: {
      daysOfTheMonth: [
        {
          date: int
          isLast: bool
        }
      ]
    }
    retentionScheduleFormatType: 'string'
    retentionScheduleWeekly: {
      daysOfTheWeek: [ 'string' ]
      weeksOfTheMonth: [ 'string' ]
    }
    retentionTimes: [ 'string' ]
  }

For SimpleRetentionPolicy, use:

  retentionPolicyType: 'SimpleRetentionPolicy'
  retentionDuration: {
    count: int
    durationType: 'string'
  }

SchedulePolicy objects

Set the schedulePolicyType property to specify the type of object.

For LogSchedulePolicy, use:

  schedulePolicyType: 'LogSchedulePolicy'
  scheduleFrequencyInMins: int

For LongTermSchedulePolicy, use:

  schedulePolicyType: 'LongTermSchedulePolicy'

For SimpleSchedulePolicy, use:

  schedulePolicyType: 'SimpleSchedulePolicy'
  scheduleRunDays: [ 'string' ]
  scheduleRunFrequency: 'string'
  scheduleRunTimes: [ 'string' ]
  scheduleWeeklyFrequency: int

Property values

vaults/backupPolicies

Name Description Value
type The resource type

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

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

See how to set names and types for child resources in Bicep or JSON ARM templates.
string (required)
location Resource location. string
tags Resource tags. Dictionary of tag names and values. See Tags in templates
parent In Bicep, you can specify the parent resource for a child resource. You only need to add this property when the child resource is declared outside of the parent resource.

For more information, see Child resource outside parent resource.
parentSymbolicName
eTag Optional ETag. string
properties Base class for backup policy. Workload-specific backup policies are derived from this class. ProtectionPolicy

ProtectionPolicy

Name Description Value
protectedItemsCount Number of items associated with this policy. int
backupManagementType Set the object type AzureIaasVM
AzureSql
AzureStorage
AzureWorkload
GenericProtectionPolicy
MAB

AzureIaaSVMProtectionPolicy

Name Description Value
backupManagementType This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. 'AzureIaasVM'
instantRPDetails InstantRPAdditionalDetails
instantRpRetentionRangeInDays Instant RP retention policy range in days int
retentionPolicy Base class for retention policy. RetentionPolicy
schedulePolicy Base class for backup schedule. SchedulePolicy
timeZone TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". string

InstantRPAdditionalDetails

Name Description Value
azureBackupRGNamePrefix string
azureBackupRGNameSuffix string

RetentionPolicy

Name Description Value
retentionPolicyType Set the object type LongTermRetentionPolicy
SimpleRetentionPolicy

LongTermRetentionPolicy

Name Description Value
retentionPolicyType This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. 'LongTermRetentionPolicy'
dailySchedule Daily retention schedule. DailyRetentionSchedule
monthlySchedule Monthly retention schedule. MonthlyRetentionSchedule
weeklySchedule Weekly retention schedule. WeeklyRetentionSchedule
yearlySchedule Yearly retention schedule. YearlyRetentionSchedule

DailyRetentionSchedule

Name Description Value
retentionDuration Retention duration. RetentionDuration
retentionTimes Retention times of retention policy. string[]

RetentionDuration

Name Description Value
count Count of duration types. Retention duration is obtained by the counting the duration type Count times.
For example, when Count = 3 and DurationType = Weeks, retention duration will be three weeks.
int
durationType Retention duration type of retention policy. 'Days'
'Invalid'
'Months'
'Weeks'
'Years'

MonthlyRetentionSchedule

Name Description Value
retentionDuration Retention duration. RetentionDuration
retentionScheduleDaily Daily retention format. DailyRetentionFormat
retentionScheduleFormatType Retention schedule format type for monthly retention policy. 'Daily'
'Invalid'
'Weekly'
retentionScheduleWeekly Weekly retention format. WeeklyRetentionFormat
retentionTimes Retention times of retention policy. string[]

DailyRetentionFormat

Name Description Value
daysOfTheMonth List of days of the month. Day[]

Day

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

WeeklyRetentionFormat

Name Description Value
daysOfTheWeek List of days of the week. String array containing any of:
'Friday'
'Monday'
'Saturday'
'Sunday'
'Thursday'
'Tuesday'
'Wednesday'
weeksOfTheMonth List of weeks of month. String array containing any of:
'First'
'Fourth'
'Invalid'
'Last'
'Second'
'Third'

WeeklyRetentionSchedule

Name Description Value
daysOfTheWeek List of days of week for weekly retention policy. String array containing any of:
'Friday'
'Monday'
'Saturday'
'Sunday'
'Thursday'
'Tuesday'
'Wednesday'
retentionDuration Retention duration. RetentionDuration
retentionTimes Retention times of retention policy. string[]

YearlyRetentionSchedule

Name Description Value
monthsOfYear List of months of year of yearly retention policy. String array containing any of:
'April'
'August'
'December'
'February'
'Invalid'
'January'
'July'
'June'
'March'
'May'
'November'
'October'
'September'
retentionDuration Retention duration. RetentionDuration
retentionScheduleDaily Daily retention format. DailyRetentionFormat
retentionScheduleFormatType Retention schedule format type for monthly retention policy. 'Daily'
'Invalid'
'Weekly'
retentionScheduleWeekly Weekly retention format. WeeklyRetentionFormat
retentionTimes Retention times of retention policy. string[]

SimpleRetentionPolicy

Name Description Value
retentionPolicyType This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. 'SimpleRetentionPolicy'
retentionDuration Retention duration. RetentionDuration

SchedulePolicy

Name Description Value
schedulePolicyType Set the object type LogSchedulePolicy
LongTermSchedulePolicy
SimpleSchedulePolicy

LogSchedulePolicy

Name Description Value
schedulePolicyType This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. 'LogSchedulePolicy'
scheduleFrequencyInMins Frequency of the log schedule operation of this policy in minutes. int

LongTermSchedulePolicy

Name Description Value
schedulePolicyType This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. 'LongTermSchedulePolicy'

SimpleSchedulePolicy

Name Description Value
schedulePolicyType This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. 'SimpleSchedulePolicy'
scheduleRunDays List of days of week this schedule has to be run. String array containing any of:
'Friday'
'Monday'
'Saturday'
'Sunday'
'Thursday'
'Tuesday'
'Wednesday'
scheduleRunFrequency Frequency of the schedule operation of this policy. 'Daily'
'Invalid'
'Weekly'
scheduleRunTimes List of times of day this schedule has to be run. string[]
scheduleWeeklyFrequency At every number weeks this schedule has to be run. int

AzureSqlProtectionPolicy

Name Description Value
backupManagementType This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. 'AzureSql'
retentionPolicy Base class for retention policy. RetentionPolicy

AzureFileShareProtectionPolicy

Name Description Value
backupManagementType This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. 'AzureStorage'
retentionPolicy Base class for retention policy. RetentionPolicy
schedulePolicy Base class for backup schedule. SchedulePolicy
timeZone TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". string
workLoadType Type of workload for the backup management 'AzureFileShare'
'AzureSqlDb'
'Client'
'Exchange'
'FileFolder'
'GenericDataSource'
'Invalid'
'SAPAseDatabase'
'SAPHanaDatabase'
'SQLDB'
'SQLDataBase'
'Sharepoint'
'SystemState'
'VM'
'VMwareVM'

AzureVmWorkloadProtectionPolicy

Name Description Value
backupManagementType This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. 'AzureWorkload'
makePolicyConsistent Fix the policy inconsistency bool
settings Common settings field for backup management Settings
subProtectionPolicy List of sub-protection policies which includes schedule and retention SubProtectionPolicy[]
workLoadType Type of workload for the backup management 'AzureFileShare'
'AzureSqlDb'
'Client'
'Exchange'
'FileFolder'
'GenericDataSource'
'Invalid'
'SAPAseDatabase'
'SAPHanaDatabase'
'SQLDB'
'SQLDataBase'
'Sharepoint'
'SystemState'
'VM'
'VMwareVM'

Settings

Name Description Value
isCompression Workload compression flag. This has been added so that 'isSqlCompression'
will be deprecated once clients upgrade to consider this flag.
bool
issqlcompression SQL compression flag bool
timeZone TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". string

SubProtectionPolicy

Name Description Value
policyType Type of backup policy type 'CopyOnlyFull'
'Differential'
'Full'
'Incremental'
'Invalid'
'Log'
retentionPolicy Base class for retention policy. RetentionPolicy
schedulePolicy Base class for backup schedule. SchedulePolicy

GenericProtectionPolicy

Name Description Value
backupManagementType This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. 'GenericProtectionPolicy'
fabricName Name of this policy's fabric. string
subProtectionPolicy List of sub-protection policies which includes schedule and retention SubProtectionPolicy[]
timeZone TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". string

MabProtectionPolicy

Name Description Value
backupManagementType This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. 'MAB'
retentionPolicy Base class for retention policy. RetentionPolicy
schedulePolicy Base class for backup schedule. SchedulePolicy

Quickstart templates

The following quickstart templates deploy this resource type.

Template Description
Backup existing File Share using Recovery Services

Deploy to Azure
This template configures protection for an existing File Share present in an existing Storage Account. It creates a new or uses an existing Recovery Services Vault and Backup Policy based on the set parameter values.
Create Daily Backup Policy for RS Vault to protect IaaSVMs

Deploy to Azure
This template creates Recovery service vault and a Daily Backup Policy that can be used to protect classic and ARM based IaaS VMs.
Azure Backup for Workload in Azure Virtual Machines

Deploy to Azure
This template creates a Recovery Services Vault and a Workload specific Backup Policy. Registers VM with Backup service and Configures Protection
Create Weekly Backup Policy for RS Vault to protect IaaSVMs

Deploy to Azure
This template creates Recovery service vault and a Daily Backup Policy that can be used to protect classic and ARM based IaaS VMs.