I'd like to be able to call my Azure function without having to specify a key. The documentation seems to indicate that setting the 'authLevel' to anonymous accomplishes this:
authLevel : This determines what keys, if any, need to be present on the request in order to invoke the function. See Working with keys below. The value can be one of the following:
- anonymous: No API key is required.
- function: A function-specific API key is required. This is the default value if none is provided.
- admin : The master key is required.
My binding is:
"bindings": [
{
"type": "httpTrigger",
"direction": "in",
"authLevel": "anonymous",
"webHookType": "genericJson",
"name": "req"
},
{
"type": "http",
"direction": "out",
"name": "res"
}
]
Yet, when I send a request to the function without a key I receive the error:
The WebHook verification request must contain a 'code' query parameter.
What am I overlooking?
Chris,
authLevel
does not apply to WebHooks as the authentication there is completely handled by the WebHook receiver you select (e.g. Slack, Generic JSON, Salesforce, etc.), you'll notice that option is disabled in the UI.
I've opened this issue to enhance the documentation with this information.
If you need an anonymous WebHook to take a JSON payload, the alternative is to use an HTTP Trigger function, set the authLevel
to anonymous and either handle the request directly or bind to a string, JObject or a POCO.