添加SQL备份策略时出现恢复服务库错误

时间:2018-11-02 19:33:49

标签: json azure azure-devops arm-template

我正在通过Azure ARM模板创建备份策略,以每周备份一次SQL备份,但出现以下错误。任何帮助,将不胜感激。

我相信vm的backupmanagemenmentype是AzureIaasVM,因此对于SQL来说是“ backupManagementType”:“ AzureWorkload”

{
      "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": "AzureWorkload"**,
        "schedulePolicy": {
          "scheduleRunFrequency": "Weekly",
          "scheduleRunDays": "[parameters('scheduleRunDays')]",
          "scheduleRunTimes": "[parameters('scheduleRunTimes')]",
          "schedulePolicyType": "SimpleSchedulePolicy"
        },
        "retentionPolicy": {
          "dailySchedule": null,
          "weeklySchedule": {
            "daysOfTheWeek": "[parameters('scheduleRunDays')]",
            "retentionTimes": "[parameters('scheduleRunTimes')]",
            "retentionDuration": {
              "count": "[parameters('weeklyRetentionDurationCount')]",
              "durationType": "Weeks"
            }
          },
          "retentionPolicyType": "LongTermRetentionPolicy"
        },
        "timeZone": "[parameters('timeZone')]"
      }
    }

我遇到以下错误

New-AzureRmResourceGroupDeployment : 01:43:52 PM - Resource Microsoft.RecoveryServices/vaults/backupPolicies 'RSVault2/SQL Backup' failed with message '{
  "error": {
    "code": "BMSUserErrorInvalidPolicyInput",
    "message": "Input for create or update policy is not in proper format\r\nPlease check format of parameters like schedule time, schedule days, retention time and retention days ",
    "target": null,
    "details": null,
    "innerError": null
  }
}'
At C:\Users\user\VSCode Azure\ARM Templates\301-Create Policies for Recovery Service Vault\rsv-policies-deploy.ps1:22 char:1
+ New-AzureRmResourceGroupDeployment -ResourceGroupName $resourceGroupN ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [New-AzureRmResourceGroupDeployment], Exception
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceGroupDeploymentCmdlet

New-AzureRmResourceGroupDeployment : 01:43:57 PM - Template output evaluation skipped: at least one resource deployment operation failed. Please list deployment operations for details. Please see
https://aka.ms/arm-debug for usage details.
At C:\Users\VSCode Azure\ARM Templates\301-Create Policies for Recovery Service Vault\rsv-policies-deploy.ps1:22 char:1
+ New-AzureRmResourceGroupDeployment -ResourceGroupName $resourceGroupN ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [New-AzureRmResourceGroupDeployment], Exception
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceGroupDeploymentCmdlet

New-AzureRmResourceGroupDeployment : 01:43:57 PM - Template output evaluation skipped: at least one resource deployment operation failed. Please list deployment operations for details. Please see
https://aka.ms/arm-debug for usage details.
At C:\Users\VSCode Azure\ARM Templates\301-Create Policies for Recovery Service Vault\rsv-policies-deploy.ps1:22 char:1
+ New-AzureRmResourceGroupDeployment -ResourceGroupName $resourceGroupN ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [New-AzureRmResourceGroupDeployment], Exception
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceGroupDeploymentCmdlet

1 个答案:

答案 0 :(得分:0)

能否请您检查是否以日期时间格式而不是以时间格式提供计划的运行时间和保留时间?

对于计划的运行时间和保留时间,其格式均应为“ 2018-01-24T10:00:00Z”。