从ADF调用Azure函数并传递Query String参数 [英] Call Azure Function from ADF and pass Query String parameters

查看:111
本文介绍了从ADF调用Azure函数并传递Query String参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图从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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆