Skip to content

Instantly share code, notes, and snippets.

@aw230012
Created January 3, 2018 18:02
Show Gist options
  • Save aw230012/ca72734073a018a3741095916f626a53 to your computer and use it in GitHub Desktop.
Save aw230012/ca72734073a018a3741095916f626a53 to your computer and use it in GitHub Desktop.
ARM Template for deploying an Azure Recovery Services Vault with a Daily policy
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"vaultName": {
"type": "string",
"metadata": {
"description": "Name of the Vault"
}
},
"skuTier": {
"type": "string",
"defaultValue": "Standard",
"allowedValues": [
"Standard"
],
"metadata": {
"description": "SKU tier for the vault"
}
},
"policyName": {
"type": "string",
"metadata": {
"description": "Name of the Backup Policy"
}
},
"scheduleRunTimes": {
"type": "array",
"metadata": {
"description": "Times in day when backup should be triggered. e.g. 01:00, 13:00. This will be used in LTR too for daily, weekly, monthly and yearly backup."
}
},
"scheduleRunTimeZone": {
"type": "string",
"defaultValue": "UTC",
"metadata": {
"description": "The timezone for the schedule run times."
}
},
"dailyRetentionDurationCount": {
"type": "int",
"metadata": {
"description": "Number of days you want to retain the backup"
}
},
"daysOfTheWeek": {
"type": "array",
"metadata": {
"description": "Backup will run on array of Days like, Monday, Tuesday etc. Applies in Weekly retention only."
}
},
"weeklyRetentionDurationCount": {
"type": "int",
"metadata": {
"description": "Number of weeks you want to retain the backup"
}
},
"monthlyRetentionDurationCount": {
"type": "int",
"metadata": {
"description": "Number of months you want to retain the backup"
}
},
"monthsOfYear": {
"type": "array",
"metadata": {
"description": "Array of Months for Yearly Retention"
}
},
"yearlyRetentionDurationCount": {
"type": "int",
"metadata": {
"description": "Number of years you want to retain the backup"
}
}
},
"resources": [
{
"type": "Microsoft.RecoveryServices/vaults",
"apiVersion": "2015-11-10",
"name": "[parameters('vaultName')]",
"location": "[resourceGroup().location]",
"sku": {
"name": "RS0",
"tier": "[parameters('skuTier')]"
},
"properties": {
}
},
{
"apiVersion": "2015-11-10",
"name": "[concat(parameters('vaultName'), '/', parameters('policyName'))]",
"type": "Microsoft.RecoveryServices/vaults/backupPolicies",
"dependsOn": [ "[concat('Microsoft.RecoveryServices/vaults/', parameters('vaultName'))]" ],
"location": "[resourceGroup().location]",
"properties": {
"backupManagementType": "AzureIaasVM",
"schedulePolicy": {
"scheduleRunFrequency": "Daily",
"scheduleRunDays": null,
"scheduleRunTimes": "[parameters('scheduleRunTimes')]",
"schedulePolicyType": "SimpleSchedulePolicy"
},
"timeZone": "[parameters('scheduleRunTimeZone')]",
"retentionPolicy": {
"dailySchedule": {
"retentionTimes": "[parameters('scheduleRunTimes')]",
"retentionDuration": {
"count": "[parameters('dailyRetentionDurationCount')]",
"durationType": "Days"
}
},
"weeklySchedule": null,
"monthlySchedule": null,
"yearlySchedule": null,
"retentionPolicyType": "LongTermRetentionPolicy"
}
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment