How to resolve "You do not have permission to view this directory or page." whenever navigating to my Azure App Browser

Jonah Foster 1 Reputation point
2023-12-15T03:28:59.8966667+00:00

Hi, I've been working with an Azure App Service and I have everything deploying correctly through Github Actions. Whenever I go to the browser I just see "You do not have permission to view this directory or page." As far as I can tell the deployment is working perfectly. Access is set to public and the default document is correct. It is a React/Node.JS app which is functional on my end. I've adjusted quite a few things on my end to attempt to get it to work to no avail. I have also cleared my cache, tried a new browser, and restarted my computer. Any help would be appreciated, thank you!

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

1 answer

Sort by: Most helpful
  1. Sedat SALMAN 14,180 Reputation points MVP
    2023-12-15T03:56:02.3533333+00:00

    This error often occurs due to issues in the deployment pipeline. Ensuring that your pipeline is correctly set up and that the application is deployed properly is crucial. It's recommended to review the deployment steps and make sure the pipeline correctly points to the necessary files and folders. Specifically, in the release pipeline task, the package folder path should be correctly mentioned, pointing up to the artifact file like a .zip file​.

    https://learn.microsoft.com/en-us/answers/questions/396669/getting-an-error-you-do-not-have-permission-to-vie#:~:text=in%20the%20release%20pipeline%20task,resolved%20the%20issue%20for%20me

    When deploying a React app, it's essential to create a production build using the 'npm run build' command, which generates a build folder with the necessary files. This build folder should be referenced while deploying the React app to Azure. Make sure that this step is correctly implemented in your deployment process​.

    https://learn.microsoft.com/en-us/answers/questions/869603/react-web-application-you-do-not-have-permission-t#:~:text=1,the%20react%20app%20to%20azure

    Azure App Service needs a default document (like index.html) to serve as the entry point for your website. If there is no default page, you may encounter the permission error. You should add the default document in the project's root folder and set it as the default page in the App settings on the Azure portal. Additionally, check for any IP restrictions or authentication settings in the Azure web application that may be causing access issues​.

    https://learn.microsoft.com/en-us/answers/questions/869603/react-web-application-you-do-not-have-permission-t#:~:text=1,the%20react%20app%20to%20azure

    If your App Service is hosted on Windows, ensure you have a web.config file to manage routing options for the IIS web server. For Linux hosts, after deploying the React app, you need to configure the use of pm2.

    1 person found this answer helpful.
    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.