我在本地的settings.json文件中有这些条目。
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "whateverstorageaccountconnectionstring",
"FUNCTIONS_WORKER_RUNTIME": "dotnet"
},
"BusinessUnitMapping": {
"Values": {
"Connections": "CON",
"Products": "PRD",
"Credit & Affordability": "CAA",
"Accounts Receivable": "ARC",
"Identity": "IDT"
}
}
}
我有这段代码来读取启动时的数值。
services.Configure<BusinessUnitMapping>(options => configuration.GetSection("BusinessUnitMapping").Bind(options));
BusinessUnitMapping是什么
public class BusinessUnitMapping
{
public Dictionary<string, string> Values { get; set; }
public BusinessUnitMapping()
{
Values = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
}
}
当我在本地运行函数应用时,它可以将这些设置读入BusinessUnitMapping而没有任何问题。
Azure门户中的应用程序设置高级编辑仅允许以下简单的键值对:
[
{
"name": "AzureWebJobsDashboard",
"value": "DefaultEndpointsProtocol=Somevalue",
"slotSetting": false
},
{
"name": "AzureWebJobsStorage",
"value": "DefaultEndpointsProtocol=Somevalue",
"slotSetting": false
},
...
]
这些问题
- 在Azure Function中存储复杂应用程序设置的方法是否正确?
- 我该如何在我已部署的Function App中在Azure Portal上配置BusinessUnitMapping?
-艾伦-