网络核心应用。我的 appsettings.json 如下所示。
{
"AzureAd": {
"Authority": "https://login.microsoftonline.com/",
"TenantId": "mytenantid",
"ClientId": "myclientid"
},
"ApplicationInsights": {
"InstrumentationKey": "myinstrumentationkey"
},
"EnableSwagger":"true"
}
我将我的应用程序部署到 azure app 服务。我在应用服务计划中有以下应用设置。
AzureAd:Authority
AzureAd:ClientId
AzureAd:TenantId
ApplicationInsights:InstrumentationKey
EnableSwagger
我面临的问题是,每当我将应用程序部署到天蓝色应用服务时,只有从应用服务配置到 appsettings.json 的 EnableSwagger 值。所以 Key:Value 类型的配置工作正常。嵌套对象键的问题,例如
"AzureAd": {
"Authority": "https://login.microsoftonline.com/"
}
此值不会从应用服务配置应用设置覆盖到我的应用程序 appsettings.json。但是我只有 "Key":"Value" 它的压倒一切。我花了整整一天,无法弄清楚这个问题。我也尝试将 appservice 配置更改为低于 syntex,因为它是 Linux。AzureAd:Authority 我替换了:用__(双下划线)这对我也有用吗?此外,仅当我通过发布管道部署应用程序时才会发生这种情况。如果我通过右键单击解决方案并配置应用服务并单击发布来手动部署。有用。我在发布管道中面临的唯一问题。有人可以提出一些想法来解决这个问题吗?任何帮助都非常感谢。谢谢