Wednesday, March 17, 2021

SOLVED - How to fix the Azure error "You do not have permission to view this directory or page" while deploying .NET Core 3.1 Angular Web App

  In this article we review how to fix the Azure error "You do not have permission to view this directory or page" while deploying .NET Core 3.1 Angular Web App  using Angular 9/10,  looking like this :




SOLVED - How to fix the Azure error "You do not have permission to view this directory or page" while deploying .NET Core 3.1 Angular Web App




This error message is quite misleading, since you do have all permissions to enter your own website, of which you are the administrator:


In order to see the error logs, on the AZURE dashboard, search for the App Service Logs:


And switch on all logs. Next, open the Log Streams to see the logs:






Next, search for the KUDU console, to open the KUDU web site and see what's going on with your site:






Press on "Go":








Also, you can open KUDU by typing https://<your app name>.scm.azurewebsites.net/DebugConsole.




After KUDU will open, open the Debug Console:


Here you can check whether everything is fine with your web site, especially if the wwwroot contains your files or if the hierarchy of the web site is incorrect.

The problem with the hierarchy of the site, is that the "Deploy to Web App..." of the Azure Extension may not deploy adequately your site. 

You probably selected your PUBLISH folder to deploy:



But instead, Azure deployed a PARENT folder ("bin\release"), therefore the integrity of your Azure web site will remain corrupted:




To solve this, open the Azure App Service extension, and open its settings:





There, change the PATH of the deployed folder:





The path MUST point to "Publish" :







You can also uncheck the Deploy Confirmation there:




Now deploy again your website:





Open Azure's KUDU, and you'll see the hierarchy fixed : 




Your Azure's website should be working by now!!!


That's All!!! In this tutorial we saw how to fix the Azure error "You do not have permission to view this directory or page" while deploying .NET Core 3.1 Angular Web App  using Angular 9/10.
Enjoy .NET Core .....

      by Carmel Schvartzman

כתב: כרמל שוורצמן