functions-authorize
functions-authorize copied to clipboard
V4 Isolated receiving 401 when calling function deployed to Azure
It has been reported that in some cases when only specifying [HttpTrigger(params string[])] would not make the function anonymously available.
Functions built-in authorization levels are disabled locally and you might see your app having the expected behavior with ASP.NET Core auth when testing locally.
If you suspect this might be happening, use [HttpTrigger(AuthorizationLevel, params string[])] and ensure is set to Anonymous, or User as this value is also not handled by Functions built-in auth; and it makes your attribute declaration shorter :wink:. I actually think that it makes sense to use User as it logically aligns with the use of the [Authorize] attribute.
I'm investigating why this is happening as the HttpTriggerAttribute does not set the authorization level when only specifying the allowed HTTP methods and the default value for AuthorizationLevel is taken, which is Anonymous.