Hi,
I'm trying to create an ARM template to create RSV with a default Backup policy. The vault is created, but the creation of the policy fails with the below error:
Status Message: Input for create or update policy is not in proper format
Please check format of parameters like schedule time, schedule days, retention time and retention days (Code:BMSUserErrorInvalidPolicyInput)
Status Message: Parameter value in request is invalid
Please provide correct value for parameter value (Code:UserErrorInvalidRequestParameter)
My template is like this:
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"CustomerID": {
"type": "int",
"minValue":100000,
"maxValue":999999,
"metadata": {
"description": "Customer ID, 6 digits"
}
},
"CustomerSubID": {
"type": "int",
"minValue":1,
"maxValue":99,
"metadata": {
"description": "Customer Sub ID, one or two dgits"
}
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "Location for Resources"
}
},
"date": {
"type": "string",
"defaultValue": "[utcNow('yyyy-MM-dd')]",
"metadata": {
"description": "Date in format yyyy-MM-dd"
}
},
"timeZone": {
"type": "string",
"defaultValue": "UTC",
"metadata": {
"description": "Any Valid timezone, for example:UTC, Pacific Standard Time. Refer: https://msdn.microsoft.com/en-us/library/gg154758.aspx"
}
},
"time2": {
"type": "string",
"defaultValue": "2021-03-08T22:00:00Z"
}
},
"functions": [],
"variables": {
"recoveryvaultName": "[toLower(concat('azpnoe','-rsv-',parameters('CustomerID'),'-',padLeft(parameters('CustomerSubID'),2,'0')))]",
"time": "[concat(parameters('date'), 'T22:00:00Z')]"
},
"resources": [
{
"name": "[variables('recoveryvaultName')]",
"type": "Microsoft.RecoveryServices/vaults",
"apiVersion": "2016-06-01",
"location": "[parameters('location')]",
"tags": {
"CustomerID": "[parameters('CustomerID')]"
},
"sku": {
"name": "RS0",
"tier": "Standard"
},
"properties": {
}
},
{
"name": "[concat(variables('recoveryvaultName'),'/VM-Policy')]",
"type": "Microsoft.RecoveryServices/vaults/backupPolicies",
"apiVersion": "2016-06-01",
"dependsOn": [
"[resourceId('Microsoft.RecoveryServices/vaults', variables('recoveryvaultName'))]"
],
"location": "[parameters('location')]",
"properties": {
"backupManagementType": "AzureIaasVM",
"instantRpRetentionRangeInDays": 2,
"schedulePolicy": {
"schedulePolicyType": "SimpleSchedulePolicy",
"scheduleRunFrequency": "Daily",
"scheduleRunTimes": [
"[variables('time')]"
],
"scheduleWeeklyFrequency": 0
},
"retentionPolicy": {
"retentionPolicyType": "LongTermRetentionPolicy",
"dailySchedule": {
"retentionTimes": [
"[variables('time')]"
],
"retentionDuration": {
"count": 5,
"durationType": "Days"
}
},
"weeklySchedule": {
"daysOfTheWeek": [
"Friday"
],
"retentionTimes": [
"[variables('time')]"
],
"retentionDuration": {
"count": 6,
"durationType": "Weeks"
}
}
},
"timeZone": "[parameters('timeZone')]"
}
}
],
"outputs": {}
}
I get the same error when trying to create using the Quickstart template "Create Daily Backup Policy for RS Vault to protect IaaSVMs"