C# Azure函数如何向绑定添加应用程序设置
我正在尝试使用我的应用程序设置为我的Azure功能添加一些自定义绑定。我只需要从我的设置中接收字符串C# Azure函数如何向绑定添加应用程序设置,c#,azure,binding,settings,azure-functions,C#,Azure,Binding,Settings,Azure Functions,我正在尝试使用我的应用程序设置为我的Azure功能添加一些自定义绑定。我只需要从我的设置中接收字符串 { "bindings": [ { "name": "someValue", "type": "stringSetting", "connection": "simpleValue", "direction": "in" } ], "disabled": false } 我想从我的设置中获取simpleValue
{
"bindings": [
{
"name": "someValue",
"type": "stringSetting",
"connection": "simpleValue",
"direction": "in"
}
],
"disabled": false
}
我想从我的设置中获取simpleValue
{
"bindings": [
{
"name": "someValue",
"type": "stringSetting",
"connection": "simpleValue",
"direction": "in"
}
],
"disabled": false
}
以及get-it-in-Run方法:
static void GetOrders(TraceWriter log, string someValue)
{
log.Info(someValue);
}
甚至有可能。也许还有别的办法吗?我已经找到了解决办法。只需添加:
using System.Configuration;
并使用键(“simpleValue”)值将此行添加到代码中:
应用程序设置配置在绑定json中可以被称为%MY_CUSTOM_CONFIG%——包含在百分比符号中 请注意,触发器和绑定的连接属性是 特殊情况,并自动将值解析为应用程序设置, 没有百分号。
它不是
ConfigurationManager.AppSettings[“bindings:connection”]
吗?