Skip to content

Instantly share code, notes, and snippets.

@kongou-ae
Created February 6, 2019 16:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kongou-ae/c72aa929242c98d1016fa42c1ab0e608 to your computer and use it in GitHub Desktop.
Save kongou-ae/c72aa929242c98d1016fa42c1ab0e608 to your computer and use it in GitHub Desktop.
{
"$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 Recovery Services 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 or 13:00. Must be an array, however for IaaS VMs only one value is valid. This will be used in LTR too for daily, weekly, monthly and yearly backup."
}
},
"timeZone": {
"type": "string",
"metadata": {
"description": "Any Valid timezone, for example:UTC, Pacific Standard Time. Refer: https://msdn.microsoft.com/en-us/library/gg154758.aspx"
}
},
"dailyRetentionDurationCount": {
"type": "int",
"metadata": {
"description": "Number of days you want to retain the backup"
}
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "Location for all resources."
}
}
},
"resources": [
{
"type": "Microsoft.RecoveryServices/vaults",
"apiVersion": "2015-11-10",
"name": "[parameters('vaultName')]",
"location": "[parameters('location')]",
"sku": {
"name": "RS0",
"tier": "Standard"
},
"properties": {}
},
{
"apiVersion": "2016-06-01",
"name": "[concat(parameters('vaultName'), '/', parameters('policyName'))]",
"type": "Microsoft.RecoveryServices/vaults/backupPolicies",
"dependsOn": [
"[concat('Microsoft.RecoveryServices/vaults/', parameters('vaultName'))]"
],
"location": "[parameters('location')]",
"properties": {
"backupManagementType": "AzureIaasVM",
"schedulePolicy": {
"scheduleRunFrequency": "Daily",
"scheduleRunDays": null,
"scheduleRunTimes": "[parameters('scheduleRunTimes')]",
"schedulePolicyType": "SimpleSchedulePolicy",
"scheduleWeeklyFrequency": 0
},
"retentionPolicy": {
"dailySchedule": {
"retentionTimes": "[parameters('scheduleRunTimes')]",
"retentionDuration": {
"count": "[parameters('dailyRetentionDurationCount')]",
"durationType": "Days"
}
},
"monthlySchedule": null,
"retentionPolicyType": "LongTermRetentionPolicy",
"weeklySchedule": null,
"yearlySchedule": null
},
"timeZone": "[parameters('timeZone')]"
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment