0
votes

The out-of-box Visual Studio 2017 (15.5.5) template for an Azure Function creates an HttpTrigger Run method with HttpRequest and TraceLog as arguments.

I'd like to use other binding types, like POCO, 'string' or 'ILogger'.

I've search quite a bit but cannot seem to find a concise list of binding types for an HttpTrigger (http web hook). Some of the articles I've found include:

What are all the possible binding types that are available for Azure Stream Job Functions?

I can start trial-and-error, but I thought i'd check first.

Thanks

-John

2

2 Answers

0
votes

When you're using an HTTP based trigger function the binding rules for the input parameter are basically HttpRequestMessage, giving you full access to the HTTP request details (e.g. headers and body), or any type that JSON.NET can deserialize from the body of the incoming HTTP request. So that could be any of the intrinsic .NET types (e.g. string, int, Guid, etc) or a custom POCO class.

0
votes

What are all the possible binding types that are available for Azure Stream Job Functions?

No. Full list of supported bindings here: https://docs.microsoft.com/en-us/azure/azure-functions/functions-triggers-bindings

You can pass string or POCO object to HttpTrigger:

  1. Passing strings using route template: https://docs.microsoft.com/en-us/azure/azure-functions/functions-triggers-bindings

  2. POCO: https://github.com/Azure/azure-functions-host/blob/v1.x/sample/HttpTrigger-CSharp-Poco/run.csx