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

使用Trusted Launch参数创建Azure VM时遇错误求助

解决Azure VM/VMSS创建时的TrustedLaunch安全类型报错

你遇到的错误是因为所选的Azure库镜像强制要求虚拟机(VM)或虚拟机规模集(VMSS)使用TrustedLaunch安全类型,而代码中未配置该参数。

修改代码方案:

  • 创建VM时,在虚拟机配置中添加SecurityProfile并指定安全类型:
var vm = new VirtualMachine
{
    // 保留你原有配置(如硬件、存储、网络等)
    SecurityProfile = new SecurityProfile
    {
        SecurityType = SecurityType.TrustedLaunch
    }
};
  • 创建VM Scale Set时,在虚拟机规模集的VM配置中添加对应安全配置:
var vmss = new VirtualMachineScaleSet
{
    // 保留你原有配置(如SKU、升级策略等)
    VirtualMachineProfile = new VirtualMachineScaleSetVMProfile
    {
        // 保留你原有VM配置(如OS、存储等)
        SecurityProfile = new SecurityProfile
        {
            SecurityType = SecurityType.TrustedLaunch
        }
    }
};

TrustedLaunch是Azure提供的安全启动机制,部分官方优化镜像会强制要求启用该类型,以此保障虚拟机启动过程的完整性与安全性。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.07 22:53:11