我想在我的 Azure Web 应用程序上的应用程序设置下设置一个键值对。
我尝试了许多不同的方法来在我的 appsettings.json 上设置它,但是没有一个有效。
这是我尝试过的:
测试1
{
"APPSETTING_WEBSITE_TIME_ZONE": "E. South America Standard Time",
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Warning"
}
}
}
还有
{
"AppSettings:WEBSITE_TIME_ZONE": "E. South America Standard Time",
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Warning"
}
}
}
另一个测试
{
"AppSettings": {
"WEBSITE_TIME_ZONE": "E. South America Standard Time"
},
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Warning"
}
}
}
最佳答案
通常,您可以在 appsettings.json
中设置应用设置。请参阅doc了解详情。
此处的问题是您尝试设置 WEBSITE_TIME_ZONE
,这是 Azure Web Apps 识别的特殊设置。为了使其有效,必须将其设置为 Azure 应用程序设置。对于各种其他特殊 WEBSITE_
设置也是如此(例如,参见 s list here )。
关于azure - 在 azure webapp 上应用 appsettings.json,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42695051/