azure - Azure App Service 应用程序设置未覆盖 .NET Core 3.1 应用程序的 application.json 数组设置
问题描述
我们有一个部署到 Microsoft Azure 的 .NET Core 3.1 应用程序。在应用程序的 application.json 文件中,我们有以下内容:
{
"Settings": {
"ServicesURIs": [
{
"Name": "Features",
"URL": "https://abc.azurewebsites.net",
"Port": "443",
"ScopeUri": "api://xxxxxx",
"enabled": "true"
},
{
"Name": "Questions",
"URL": "https://def.azurewebsites.net",
"Port": "443",
"ScopeUri": "api://XXXXX",
"enabled": "true"
}
]
},
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*",
"pwa": {
"cacheId": "v1.3",
"strategy": "networkFirst",
"registerWebmanifest": true,
"routesToPreCache": "/"
}
}
我希望覆盖 Azure 中应用程序服务配置中应用程序设置部分的 URL 属性。
我目前在每个文档和许多在线博客的配置刀片中指定以下应用程序设置:
Name= Settings:ServicesURIs:0:URL
Value= https://Somevalidurl.azurewebsites.net
但是我发现应用程序没有使用门户配置中的值,并且总是尝试使用 .json 文件中的值。
我尝试将名称指定为
Settings__ServicesURIs__0__URL
(其中“:”替换为双下划线)
在 Azure 中注册设置后,我已重新启动应用程序服务。
我在 Incognito 中使用 Chrome 对此进行了测试,以确保缓存不起作用。
解决方案
推荐阅读
- visual-studio - Visual Studio,如何在调试模式下显示变量数组
- mysql - 如何查找结束日期为空的员工可用性重叠
- rabbitmq - 一旦连接失败,Spring消费者不会重新连接到rabbit mq队列
- android - 您可以将 com.google.crypto.tink 配置为使用 androidx.datastore 而不是 Shared Prefs
- css - iOS 输入 [type="search"] 刷新后不起作用
- java - 使用 java 的 Postgres 连接池
- php - 仅当出现“,”时才拆分数组
- matlab - 用于远程函数调用的最简单的网络协议?
- python - bazel 3.7.2 上用于在 MAC M1 上设置媒体管道的替代类型“darwin-arm64”可能是什么?
- php - 在 PHP 升级到 PHP8 之前识别类型杂耍问题