App service authentication results in "You do not have permission to view this directory or page."

Parag Kale 25 Reputation points
2025-04-28T10:25:49.9633333+00:00

I have set up Azure function app and set up the authentication by creating App registration and followed the steps to set up easy auth.

https://learn.microsoft.com/en-us/azure/app-service/overview-authentication-authorization

https://learn.microsoft.com/en-us/azure/app-service/configure-authentication-provider-aad

I keep getting "You do not have permission to view this directory or page." . Also I don't see any token in the bearer token section

I restarted the function app multiple times , but the error keeps coming.

Appreciate any help in resolving this

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,808 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Khadeer Ali 5,155 Reputation points Microsoft External Staff Moderator
    2025-04-28T12:18:24.6133333+00:00

    @Parag Kale ,

    The error message "You do not have permission to view this directory or page" typically appears when the Azure Function App is expecting authentication, but no valid authentication token is provided.

    In your case, it seems that the authentication (Easy Auth) is enabled, but the app is not redirecting users to sign in.

    Please check the following:

    Ensure that the App Registration has the correct Redirect URI set to: https://<yourfunction>.azurewebsites.net/.auth/login/aad/callback

    In the Function App Authentication settings, configure Unauthenticated requests to "Redirect to login page" instead of blocking them.

    After making these changes, try accessing your function again. You should be redirected to sign in and, upon successful authentication, be able to access your app without error.
    If this answers your query, do click Accept Answer and Yes for "Was this answer helpful." And if you have any further questions, let us know.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.