我正在尝试使用我的 Azure 函数的应用程序设置添加一些自定义绑定。我只需要从我的设置中接收字符串。
我想从我的设置中获取 simpleValue 。
{
"bindings": [
{
"name": "someValue",
"type": "stringSetting",
"connection": "simpleValue",
"direction": "in"
}
],
"disabled": false
}
并在 Run 方法中获取它:
static void GetOrders(TraceWriter log, string someValue)
{
log.Info(someValue);
}
有可能吗?也许还有其他方法可以做到这一点?
我已经找到了解决方案。只需添加:
using System.Configuration;
并将此行添加到带有键(“simpleValue”)值的代码中:
ConfigurationManager.AppSettings["simpleValue"]
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)