Bicep -无法为Azure恢复服务保管库创建虚拟机快照备份策略

8tntrjer  于 2022-11-17  发布在  其他
关注(0)|答案(1)|浏览(126)

我正在尝试使用Bicep将Recovery Services Vault部署为基础架构版本的一部分。我在部署一个备份策略时遇到了问题,尤其是虚拟机快照备份策略(AzureIaaSVM)。
我已经按照Bicep参考页面创建了模板,但在尝试部署时验证失败。我正在使用VSCode进行开发,当我从Bicep文件构建ARM模板时,验证失败,并显示以下消息:

如果我对文档的理解正确的话,这里应该不仅仅允许“AzureStorage”。
我的问题是,这是一个工具/API的问题还是我误解了文档?如果是,我需要修改什么才能让它工作?
模板:

resource vmSnapshotBackupPolicy 'Microsoft.RecoveryServices/vaults/backupPolicies@2022-03-01' = {
  name: 'vm-snapshot-policy'
  location: resourceLocation
  parent: recoveryServicesVault
  properties: {
    protectedItemsCount: 0
    backupManagementType: 'AzureIaasVM'
    instantRPDetails: {
      azureBackupRGNamePrefix: 'vmsnapshot'
    }
    instantRpRetentionRangeInDays: 2
    policyType: 'V1'
    retentionPolicy: {
      retentionPolicyType: 'LongTermRetentionPolicy'
      dailySchedule: {
        retentionDuration: {
          count: 7
          durationType: 'Days'
        }
        retentionTimes: [
          '2022-10-21T02:00:00Z'
        ]
      }
      monthlySchedule: {
        retentionDuration: {
          count: 6
          durationType: 'Months'
        }
        retentionScheduleDaily: {
          daysOfTheMonth: [
            {
              date: 1
              isLast: false
            }
          ]
        }
        retentionScheduleFormatType: 'Daily'
        retentionTimes: [
          '2022-10-21T02:00:00Z'
        ]
      }
      weeklySchedule: {
        daysOfTheWeek: [
          'Sunday'
        ]
        retentionDuration: {
          count: 4
          durationType: 'Weeks'
        }
        retentionTimes: [
          '2022-10-21T02:00:00Z'
        ]
      }
      yearlySchedule: {
        monthsOfYear: [
          'July'
        ]
        retentionDuration: {
          count: 2
          durationType: 'Years'
        }
        retentionScheduleDaily: {
          daysOfTheMonth: [
            {
              date: 1
              isLast: false
            }
          ]
        }
        retentionScheduleFormatType: 'Daily'
        retentionTimes: [
          '2022-10-21T02:00:00Z'
        ]
      }
    }
    schedulePolicy: {
      schedulePolicyType: 'SimpleSchedulePolicy'
      scheduleRunFrequency: 'Daily'
      scheduleRunTimes: [
        '2022-10-21T02:00:00Z'
      ]
      scheduleWeeklyFrequency: 0
    }
    timeZone: 'UTC'
  }

}

相关问题