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

Azure App Service(Linux)环境下ASP.NET Core应用的环境变量问题

Azure App Service(Linux)环境下ASP.NET Core应用的环境变量问题

我手头有个ASP.NET Core应用,目前配置文件和Program类的代码如下,想咨询关于环境变量配置的相关问题:

配置文件详情

appsettings.json

...
"AzureOpenAI": {
    "EndPoint": "https://PRODUCTION.openai.azure.com/",
    "ApiKey": "PRODUCTION-API-KEY"
},
"ServiceBus": {
    "ConnectionString": "PRODUCTION-CONNECTION-STRING",
    "QueueNames": {
      "Files": "files",
      "SessionCallBack": "sessionCallBack"
   }
}
...

appsettings.staging.json

...
"AzureOpenAI": {
    "EndPoint": "https://STAGING.openai.azure.com/",
    "ApiKey": "STAGING-API-KEY"
},
"ServiceBus": {
    "ConnectionString": "STAGING-CONNECTION-STRING"
}
...

Program类代码片段

...
var env = builder.Environment.EnvironmentName;
var...

备注:内容来源于stack exchange,提问作者Imran Sh

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.04.16 08:18:10