从ADF调用Azure函数并传递Query String参数 [英] Call Azure Function from ADF and pass Query String parameters
问题描述
我试图从Data Factory调用HTTP触发器Azure函数并为GET传递参数方法如下:
{
" functionName":" AzFnFileService",
    " method" ;:\"GET",
    "标题":{
;      " op" ;:"存在",
        " inputfolder":" src",
        " file":" eula.txt",
        "targetfolder":" tgt"
    },
"body":""
}
但是,Azure功能似乎无法读取参数/标头。从浏览器调用时,Azure功能完美地工作
。我的Azure功能的返回类型是JObject。有没有人知道如何从ADF为Azure函数传递查询字符串。
嗨Rahul,
从ADF结束看,一切都很好。我在我的实例上尝试了相同的操作,并且能够在Azure函数中接收所有标头。
您是否收到任何错误?请确保使用正确的语法来获取标题。例如:
在C#中,它将类似于:
string header1
= req.Headers [ " op" ];
在NodeJS中,它可能是这样的:
req.headers ['op' ]
I am trying to call a HTTP trigger Azure Function from Data Factory and pass parameters for GET method as follows:
{
"functionName": "AzFnFileService",
"method": "GET",
"headers": {
"op": "exist",
"inputfolder": "src",
"file": "eula.txt",
"targetfolder": "tgt"
},
"body": ""
}
However, it seems Azure Function is not able to read the parameters/headers. The Azure Function works perfectly fine when called from Browser. The return type for my Azure Function is a JObject. Does anybody know how to pass Query String from ADF for Azure Function.
Hi Rahul,
Everything looks fine from ADF end. I have tried out the same on my instance and am able to receive all headers in the Azure function.
Are you getting any error ? Please make sure you are using the right syntax to get headers. For example :
In C#, it would be something like :
string header1 = req.Headers["op"];
In NodeJS, it could be something like :
req.headers['op']
这篇关于从ADF调用Azure函数并传递Query String参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!