我有一组应用程序设置值,如下所示。我们使用 Windows 应用服务
"MainDomains": {
"Domains": [
{
"Id": "123456",
"Domain": "Technical",
"PolicyUrl": "https://www.mytechdomain.net",
"LearningPoint": "https://www.mytechdomain.net",
"Hostnames": [
"https://localhost:4567",
"http://localhost:34565",
"https://mytechdomain.latestlearn.com"
],
"UsePreviewContent": true,
"IsDefault": true,
"OriginEmail": "<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="5b32353d341b2f3e38333f34363a323575353e2f" rel="noreferrer noopener nofollow">[email protected]</a>",
"mytechname": "Techdomain"
}
]
}
我如何在配置下的 Azure 应用程序设置中正确设置这些值。我已经尝试过像property1:property2:0 --> xxxvalue。但这似乎不起作用。我猜测可能是我在另一个数组中有一个数组。其中第一个数组是 MainDomains,MainDomains 数组中的另一个数组是域。
最佳答案
您应该在 appsettings.json
中使用相同的分隔格式设置应用设置名称。但就像 Gaurav Mantri 所说,在门户上使用双下划线 __
而不是 :
。
引用Configuration keys and values的描述:
In environment variables, a colon separator may not work on all platforms. A double underscore,
__
, is supported by all platforms and is automatically converted into a colon:
.
关于asp.net - 覆盖 Azure 应用程序设置中的 appsettings.json 值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66901254/