Reputation: 137
I need to pass header information in Azure Function activity in Data Factory. As can be seen in the picture, the header is marked in red.
I need to change the following code to receive the header. I also need to capture the value of the header.
public static async Task Run([HttpTrigger(AuthorizationLevel.Function, "get", Route = "{name}" )] HttpRequestMessage req, string name, TraceWriter log, [Blob("pk-api-test/{name}", FileAccess.Read)] Stream myBlob)
Upvotes: 0
Views: 958
Reputation: 137
I solved it by using 'Route = TestFunction/{name}' in the code and in the Azure function settings in Data Factory, I used the Function Name = TestFunction/albany
Upvotes: 1
Reputation: 17800
Have a try at code below. Use headers
to access headers info in http request.
public static async Task Run(
[HttpTrigger(AuthorizationLevel.Function, "get", Route = null)]HttpRequestMessage req,
[Blob("pk-api-test/{headers.name}", FileAccess.Read)]Stream myBlob,
IDictionary<string, string> headers,
TraceWriter log)
{
string name = headers["name"];
//...
}
Upvotes: 0