Get ADF v2 parameter into Azure Function Pychon code.

mandania 156 Reputation points
2021-08-23T12:27:16.007+00:00

Hi,

Here is the scenario.

I have Azure Function code written in python and correctly deployed to azure. I have also created a pipeline with Copy activity with a DateTime string as a parameter. I wish to pass this parameter to Azure function.How do tell azure function that there is a parameter available to be processed and how do i get it into my pyhon code so i can use and log it? I am not sure if i have to configure my binding file , if so how do i do it? or if there is another way to approach it ?

125580-az-param.jpg

125640-az-param2.jpg

This is my entry point

def main(req: func.HttpRequest) -> func.HttpResponse:

.function.json

{
"scriptFile": "init.py",
"bindings": [
{
"authLevel": "anonymous",
"type": "httpTrigger",
"direction": "in",
"name": "req",
"methods": [
"get",
"post"
]
},
{
"type": "http",
"direction": "out",
"name": "$return"
}
]
}

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
0 comments No comments
{count} votes

Answer accepted by question author
  1. mandania 156 Reputation points
    2021-08-24T12:47:04.737+00:00

    I have managed to find the solution to my own problem.

    def main(req: func.HttpRequest)-> func.HttpResponse:

       datevalue = req.headers.get("af_datevalue")   
    

    The value is to be defined as a HEADER and not in the body.

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

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