Azure Function App Secured by AAD App registration. 401 - you do not have permission to view this directory or page

Zakaria Muhammad 161 Reputation points

I created a simple function with default code to say Hello <name>. I am able to run the code if the Authentication Settings under (Function -> Authentication) is set to "Allow unauthenticated Access".

As soon as I change those to "Require authentication" and add a Identity provider by following the documentation ( the simple code start throwing Error. I am using Postman and able to generate the token but when I pass that tokens to access the function, it says 401 did I miss any configuration. I am gone through a lot of community article but none of them is clear. I still think that I am missing some authorization permission for the App Registration account which is not mentioned in the above article because as being a Global admin, I am able to access the function directly using browser and my credentials.


Token generator


Pass Token to call the function.


Error "You do not have permission to view this directory or page."

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
3,999 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
18,626 questions
{count} vote

Accepted answer
  1. Zakaria Muhammad 161 Reputation points

    Followed this documentation "" and successfully configured the function with AAD authentication.

    the only thing is that, for me the Authentication (Classic) was greyed out and I have to recreate the new Azure Function.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Sam Johnson 6 Reputation points

    Suggestion: Make it clear that one cannot simply switch back to 'Classic' once trying the new experience.

    Figured an improved version would be easier to use. I've tried it twice so far, no success, and I'm uncertain why this left preview. Would love to see some good documentation for it.


    0 comments No comments