[英]How to use IOptions pattern in Azure Function V3 using .NET Core
[英]How can I use the Options pattern (IOptions) with Azure Functions Premium? (it does not allow colons in app setting names)
摘要:我想将Options Pattern与 Azure Functions Premium 一起使用,但为此我需要将应用程序设置格式设置为:
"Values": {
"MyOptions:MyCustomSetting": "Foobar"
}
但似乎 Azure Functions Premium 不允许在应用程序设置名称中使用冒号“:”。
Azure Functions premium 中的选项模式是否可行?
更多详情:
我最近将一个应用程序从消费计划迁移到了高级计划。 为此,我删除并重新创建了 function 应用程序,但部署失败并出现错误:
AppSetting with name 'OidcApiAuthSettings:Audience' is not allowed
在我的应用程序的消费计划版本中,我有一堆使用这种格式的设置,以便遵循强类型配置的选项模式。
我通过门户查看,果然,在消费计划中我可以创建这种格式的设置,但在高级计划中我收到一条消息: “应用程序设置名称只能包含字母、数字 (0-9)、句点 ( ".") 和下划线 ("_")"
使用双下划线替换冒号:
'OidcApiAuthSettings__Audience'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.