azure function authLevel anonymous requests authentication

Ken Faubel 26 Reputation points
2022-04-16T19:23:38.393+00:00

I have been working with Azure functions with timer triggers for a while but I am now trying to get an httpTrigger to work and I must be doing something dumb. My project uses Nodejs (16) and I want anonymous access so I have my function.json setup like this:

{
  "bindings": [
    {
      "authLevel": "anonymous",
      "type": "httpTrigger",
      "direction": "in",
      "name": "req",
      "methods": [ "get" ],
      "route": "test/{key:alpha}"
    },
    {
      "type": "http",
      "direction": "out",
      "name": "res"
    }
  ],
  "scriptFile": "../dist/test/index.js"
}

When I run it locally with Advanced REST Client the function gets called and everything is good.

When I deploy it to Azure and run the request again it prompts with "Authentication required, The endpoint requires user credentials".

I looked around the settings in the Azure portal and everything looks OK to me. I see this and my other trigger functions and I can see under Integration that the function is setup for anonymous authorization.

I have been digging through articles about but no clues as to what I am doing wrong. Any ideas?

Many thanks

Ken

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,387 questions
{count} votes