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

Bicep部署Windows App Service Plan失败,始终生成Linux实例求助

问题原因及解决方法

问题核心出在properties.reserved属性的设置上:

  • 在Azure App Service Plan的配置逻辑里,reserved: true是Linux环境专属的强制标识——只要这个值设为true,哪怕你把kind指定为windows,Azure也会自动创建Linux类型的App Service Plan。
  • 对于Windows类型的App Service Plan,你需要将reserved设为false,或者直接删除这个属性(因为Windows环境的reserved默认值就是false)。

修改后的BICEP代码

resource appServicePlan 'Microsoft.Web/serverfarms@2022-03-01' = {
  name: appServicePlanName
  location: location
  kind: 'windows'
  tags: tagValues
  properties: {
    reserved: false // 改为false,或直接删除该属性
  } 
  sku:  {
    name: sku
    tier: skucode
  }
}

补充说明

  • kind字段仅用于标识资源的通用类型,但reserved属性才是区分Linux/Windows App Service Plan的核心配置项,优先级更高。
  • 你使用的P1V2(PremiumV2)SKU同时支持Windows和Linux环境,所以SKU配置本身没有问题,只需修正reserved的取值即可。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.16 00:30:54