You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

ARM模板部署报错:找不到SecurityProfile的securityType成员求助

解决ARM模板部署Trusted Launch虚拟机时的"securityType"字段错误

问题核心原因

这个错误的本质是你使用的虚拟机资源API版本过低——旧版Microsoft.Compute/virtualMachines的API定义中并未包含securityProfile.securityType字段,而Trusted Launch特性是在较新的API版本中才被引入的。

具体解决步骤

1. 升级虚拟机资源的API版本

确保ARM模板中虚拟机资源的apiVersion至少为2020-12-01(Trusted Launch首次支持的最低版本),推荐使用最新稳定版(比如2023-07-01)。

修改示例:

{
  "type": "Microsoft.Compute/virtualMachines",
  "apiVersion": "2023-07-01", // 替换为符合要求的版本
  "name": "[variables('vmName')]",
  "location": "[parameters('location')]",
  "properties": {
    // 其他原有配置...
    "securityProfile": {
      "securityType": "[variables('securityType')]",
      "uefiSettings": {
        "secureBootEnabled": "[variables('secureBoot')]",
        "vTpmEnabled": "[variables('vTPMEnabled')]"
      }
    }
  }
}

2. 验证配置细节一致性

对比Azure门户生成的模板,重点确认两点:

  • 虚拟机资源的apiVersion是否与门户模板完全一致
  • securityProfile内的字段拼写是否准确(比如vTpmEnabled严格匹配官方定义,避免大小写不一致的潜在问题)

3. 重新执行部署

完成API版本升级和配置校验后,重新部署ARM模板即可解决该字段不存在的错误。


内容的提问来源于stack exchange,提问作者BlaineV

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.17 11:55:22