考虑一下appsettings.json:
{
"Parent": {
"ChildOne": "C1 from secrets.json",
"ChildTwo": "C2 from secrets.json"
}
}
Run Code Online (Sandbox Code Playgroud)
根据Microsoft(https://blogs.msdn.microsoft.com/waws/2018/06/12/asp-net-core-settings-for-azure-app-service/)的说明,是否已部署使用此配置的应用程序到Azure中的AppService,可以通过在Azure中以样式Parent:ChildOne/ 创建应用程序设置来覆盖配置Parent:ChildTwo。需要明确的是:使用冒号来定位特定的配置。
使用标准AppService可以正常工作:
但是,如果您使用Web App for Containers /即将Docker映像部署到Linux上的Azure App Service(https://docs.microsoft.com/zh-cn/azure/app-service/containers/app-service -linux-intro),您不能使用冒号:
为什么?
将鼠标悬停在错误上时,您会看到以下消息:This field can only contain letters, numbers (0-9), periods ("."), and underscores ("_")。使用.不起作用las。
您如何Parent:ChildOne在Azure中配置说?Parent.ChildOne不起作用。有人可以建议吗?我找不到关于此的任何文档。