How do you fix an Azure Portal web app with no permission to view the directory or page?

Simba Bryn Mahaja 100 Reputation points
2025-02-26T15:43:05.4+00:00

After deploying with the AZ web app deploy, a fault appeared on my web app: 'You do not have permission to view this directory or page.' Before the deployment, the web app was running and waiting for content. Most of the deployment settings have been checked and configured. How can I improve this?

Azure App Service
Azure App Service

Azure App Service is a service used to create and deploy scalable, mission-critical web apps.

0 comments No comments

Answer accepted by question author
Divyesh Govaerdhanan 11,890 Reputation points MVP Volunteer Moderator
2025-02-26T23:05:33.3766667+00:00

Hello,

Welcome to Microsoft Q&A,

This issue often arises due to misconfigurations during deployment. Here's a structured approach to diagnose and resolve the problem:

1. Verify Deployment Artifacts:

  • Check Deployed Files: Ensure that your application files are correctly deployed to the wwwroot directory.
  • Access the Kudu Console by navigating to https://<your-app-name>.scm.azurewebsites.net/DebugConsole.
    • Navigate to site/wwwroot and confirm that your application files are present.
    • If files are missing or located in subdirectories (e.g., site/wwwroot/your-app/), adjust your deployment process to place files directly in wwwroot.

2. Configure Default Documents:

  • Set Default Page: Azure requires a default document (e.g., index.html, default.aspx) to serve when accessing the root URL.
    • In the Azure Portal, navigate to your Web App.
    • Go to Settings > Configuration > Default Documents.
    • Ensure that your application's main page is listed here. If not, add it and move it to the top of the list.

3. Enable Detailed Error Messages:

  • Activate Detailed Logs: Detailed error messages can provide insights into the root cause.
  • In the Azure Portal, navigate to your Web App.
  • Go to App Service Logs.
  • Enable Detailed Error Messages.
    • After reproducing the error, review the logs in the Log Stream or Log Files section.

5. Validate Application Configuration:

  • In the Azure Portal, navigate to your Web App.
  • Go to Settings > Configuration
  • Ensure that the .Net Version is correct according to the deployed application. If it is not correct adjust it to the correct version and try again.

Please Upvote and Accept the answer if it helps!!

Was this answer helpful?

0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

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