Query Azure Function HTTP Get from Azure Data Factory

Christian Hansen 21 Reputation points
2020-11-13T12:22:03.513+00:00

I have a function like:

public static async Task<IActionResult> Run(
            [HttpTrigger(AuthorizationLevel.Function, "get", Route = null)] HttpRequest req,
            ILogger log)
        {
            string dateFromString = req.Query["dateFrom"];
            // use string
        }

I want to trigger this from Data Factory, however when I add the Function in Data Factory and select the GET method I don't have any options to put in query. If I put something in the headers it does not get read, and if I change method to POST I get a not found error.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,016 questions
Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,728 questions
0 comments No comments
{count} votes

Accepted answer
  1. MartinJaffer-MSFT 26,086 Reputation points
    2020-11-13T23:29:14.817+00:00

    Hello @ChristianHansen-0520 and welcome to Microsoft Q&A and thank you for bringing this issue to our attention.

    I have reproduced your issue and see what you mean. It is possible to add a query, but not obvious from the user interface alone.

    The query should be appended to the function name, like

    MyQueryName?dateFrom=Tuesday

    (See here for more information)

    If you would like to see the query broken out as a separate input, please suggest it in the feedback forum.

    Also, it is worth noting it is possible to query the Azure Function App via the Web Activity. This has the added benefit of not requiring JSON response. In the Azure Portal, in the Function App, there is a button "Get Function URL". This is what would be used in the Web activity.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.