【发布时间】:2022-02-05 00:57:28
【问题描述】:
我目前正在尝试在 Azure 应用服务配置中创建一个“复杂”的 appsettings 结构,但我失败了。
我的 appsettings.json 看起来……像这样:
{
"AgentPools": [
{
"Id": "1",
"Name": "PoolName1",
"AllowedProjects": []
},
{
"Id": "2",
"Name": "PoolName2",
"AllowedProjects": [
"myproject1",
"myproject2"
]
}
]
}
我现在的问题是,似乎我在数组中该数组的设置中做错了什么。
Azure 应用服务 (Linux) 中的配置如下所示:
- AgentPools__0__Id -> 1 => 工作
- AgentPools__0__Name -> PoolName1 => 工作
- AgentPools__1__Id -> 2 => 工作
- AgentPools__1__Name -> Poolname2 => 工作
- AgentPools__1__AllowedProjects__0 -> myproject1 => 不工作
- AgentPools__1__AllowedProjects__1 -> myproject2 => 不工作
我真的做错了什么,或者甚至不可能构建一个更复杂的结构吗?
我在 netcore 中编程。
【问题讨论】:
标签: azure azure-web-app-service