How to parametrize the Azure Function

This short post should demonstrate how to parazmetrize the A\ure Function that is triggered by HTTP/S request.

For example, the caller uses following URL with two argyments and some optional route:

The route is specified in bindings section:

"configurationSource": "attributes",
  "bindings": [
      "type": "httpTrigger",
      "route": "myoptionalroute/arg1/arg2",
      "methods": [
      "authLevel": "function",
      "name": "req"

Finally, the function should be decorated as shown in the following example:

public static async Task<IActionResult> Run([HttpTrigger(AuthorizationLevel.Function, 
"get", Route = "myoptionalroute/{arg1}/{arg2}")] HttpRequest req, 
string policyHolder, string policyNumber, ILogger log)
            log.LogInformation($"PolicyDocs Function recieved a request for document '{policyHolder}-{policyNumber}.pdf'.");


comments powered by Disqus