从function.json获取输入/输出绑定值| C#脚本 [英] Get input/output binding values from function.json | C# script
问题描述
有一个使用C#脚本代码的CosmosDBTrigger Azure函数.
There is a CosmosDBTrigger Azure function using C# script code.
是否可以读取run.csx代码中function.json中提供的值(如databaseName,collectionName).
Is there a way to read the values given in function.json (like databaseName, collectionName) in run.csx code.
请找到以下使用的代码.
Please find below code used.
function.json
function.json
推荐答案
AFAIK没有内置的方法.
AFAIK there is no built-in way to do this.
一种可能的破解方法是仅从代码中的磁盘读取并解析JSON. JSON通常存在于 %HOME%\ site \ wwroot \< functionName> \ function.json .
One possible hack would be to just read and parse the JSON from disk in your code. The JSON is usually present at %HOME%\site\wwroot\<functionName>\function.json.
此外,如果您可以分享尝试的内容,那么可能会有更好的解决方案.
Also, if you could share what it is that you are trying, there is probably a better solution for that.
这篇关于从function.json获取输入/输出绑定值| C#脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!