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

使用Bicep部署Windows Azure App Service(.NET 6)时运行时显示异常

Azure Windows App Service栈在门户显示为空的问题

我已创建Bicep模板,用于部署支持Linux/Windows选择及.NET 6栈的App Service Plan与App Service。部署均成功完成,Linux应用运行正常,门户中可见.NET 6栈;但Windows应用的栈在门户界面中显示为空。

使用的参数

  • Linux环境参数:
linuxFxVersion: 'DOTNETCORE|6.0'
  • Windows环境参数:
windowsFxVersion: 'dotnet:6'
netFrameworkVersion: 'v6.0'

验证步骤

通过Azure CLI命令查看允许的Windows运行时,确认dotnet:6是合法值:

az webapp list-runtimes --os windows --os-type windows

命令输出片段:

[
  "dotnet:7",
  "dotnet:6",
  "ASPNET:V4.8",
  "ASPNET:V3.5",
  "NODE:18LTS",
...
]

通过PowerShell确认配置已应用至Web App,但门户界面仍无栈信息显示。

已尝试的解决方案

试过dotnet|6、dotnetcore|6等不同参数组合,也尝试移除netFrameworkVersion,均未解决问题。

请问这是Azure界面bug,还是我遗漏了什么配置?附上完整Bicep代码如下:

@description('Generate unique String for resource names')
param uniqueFullRGString string = uniqueString(resourceGroup().id)

@description('Short unique name based on RG name')
param uniqueRGString string = take(uniqueFullRGString, 4)

@description('Resource group location')
param location string = resourceGroup().location

@description('Azure Tenant Id')
var azureTenantId = tenant().tenantId

@description('App Service Plan OS')
@allowed([
  'linux'
  'windows'
])
param appServicePlanOS string

var linuxOffer = 'linux'
var windowsOffer = 'windows'

@description('App Service Plan SKU')
param appServicePlanSku string = 'F0'

var configReferenceLinux = {
  linuxFxVersion: 'DOTNETCORE|6.0'
  appSettings: [
    {
      name: 'TenantId'
      value: azureTenantId
    }
  ]
}

var configReferenceWindows = {
  windowsFxVersion: 'dotnet:6'
  netFrameworkVersion: 'v6.0'
  appSettings: [
    {
      name: 'TenantId'
      value: azureTenantId
    }
  ]
}

@description('App Service Plan name')
var appServicePlanName = 'App-${uniqueRGString}'

resource appServicePlan 'Microsoft.Web/serverfarms@2022-03-01' = {
  name: appServicePlanName
  location: location
  sku: {
    name: appServicePlanSku
  }
  properties: {
      reserved: ((appServicePlanOS == 'linux') ? true : false)
  }
  kind: ((appServicePlanOS == 'linux') ? linuxOffer : windowsOffer)
}

resource appService 'Microsoft.Web/sites@2020-06-01' = {
  name: appServicePlanName
  location: location
  properties: {
    serverFarmId: appServicePlan.id
    siteConfig: ((appServicePlanOS == 'linux') ? configReferenceLinux : configReferenceWindows)
  }
  identity: {
    type: 'SystemAssigned'
  }
}

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.06 23:55:15