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

通过Bicep部署Azure Web App未正确设置.NET 7运行时堆栈

解决Azure Web App通过Bicep配置ASP.NET Core 7.0的问题

你当前配置里的netFrameworkVersion仅针对传统.NET Framework应用,ASP.NET Core作为跨平台框架,需要根据Web App的操作系统类型补充对应配置,才能正确设置.NET 7运行时:

1. Windows宿主场景

需添加windowsFxVersion配置,与netFrameworkVersion配合使用:

netFrameworkVersion: 'v7.0'
windowsFxVersion: 'ASP.NET V7.0'
requestTracingEnabled: true
remoteDebuggingEnabled: true
remoteDebuggingVersion: 'VS2022'
httpLoggingEnabled: true
use32BitWorkerProcess: false
ftpsState: 'FtpsOnly'
managedPipelineMode: 'Integrated'

2. Linux宿主场景

需添加linuxFxVersion配置,此时netFrameworkVersion可移除(Linux不支持.NET Framework):

linuxFxVersion: 'DOTNETCORE|7.0'
requestTracingEnabled: true
remoteDebuggingEnabled: true
remoteDebuggingVersion: 'VS2022'
httpLoggingEnabled: true
use32BitWorkerProcess: false
ftpsState: 'FtpsOnly'
managedPipelineMode: 'Integrated'

额外兜底配置(若上述设置仍不生效)

可在siteConfig下补充metadata节点,明确指定运行时栈:

metadata: [
  {
    name: 'CURRENT_STACK'
    value: 'dotnetcore'
  }
]

关键注意点

  • 必须保证Web App服务计划的操作系统(Windows/Linux)与配置的FxVersion字段匹配,否则配置不会生效。
  • ASP.NET Core和.NET Framework的配置字段不通用,不要混淆使用。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.04 07:10:46