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

Zakaria Muhammad 151 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 Active Directory
Azure Active Directory
An Azure enterprise identity service that provides single sign-on and multi-factor authentication.
12,643 questions
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
2,597 questions
1 vote

Accepted answer
  1. Zakaria Muhammad 151 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.

    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.


    No comments