2
votes

I just upgrading my Azure service from free level to basic level to get more file storage space. But now accessing my first newly deployed Web app shows: "You do not have permission to view this directory or page." The deployment from Bitbucket worked. The kudu console shows everything loaded. I have 3 branches in my repo and three Azure apps defined, one for each. Two were deployed before upgrading and they are okay. The third was just deployed after the upgrade and has this problem. All three come from the same repo, and at this time all three branches are basically the same. All are the same basic ASP.NET Core 1.0 web app for each branch. I checked a lot of google pages, but none were helpful. Where do I go to fix this?

2
This just means that the website didn't load so the IIS server is falling back and trying to load one of the html files it has in the list for startup which you wouldn't have since it should be loading up your site code instead, the directory listing is the last thing it could show and will fail in this scenario. You will need to provide more information on how it is initializing the startup code to have any hope of helping here. Pay special attention to any differences in the deployment methods or any changes made to the Startup.cs file.Bryan Roberts
The deployment from Bitbucket completes without error. Startup.cs is the same as it ever was, I have only been changing the cshtml views. There must be some administrative setting that relates to this permission setting.MartinDuo
I just deleted the AppService that started having this problem. Then I created a newly named AppService hoping a fresh start might work. It deployed from my same Bitbucket repo but still has the "You do not have permission to view this directory or page" problem. This is a ASP,NET Core 1.0 app that runs on localhost:5000 after doing "dotnet run", so I assume the code is correct. The Azure dashboard is hard to navigate searching for clues; have not found any help there.MartinDuo
@Bryan Roberts I apologize for being so thick-headed. You gave me the correct information, but I don't yet have my head around all the plumbing involved with IIS server, ASP.Net, Azure, etc. When I grasped what you meant and still I couldn't see any thing wrong in the code, I just started from scratch with a new Dotnet CLI framework, new repos, new App Service. Now it all works. I still don't know what was wrong. Post your comment as an answer and I'll accept it. Thanks for your response.MartinDuo

2 Answers

2
votes

This just means that the website didn't load so the IIS server is falling back and trying to load one of the html files it has in the list for startup which you wouldn't have since it should be loading up your site code instead, the directory listing is the last thing it could show and will fail in this scenario. Pay special attention to any differences in the deployment methods or any changes made to the Startup.cs file.

1
votes

Your application files may not have deployed correctly. The root / gave me:

You do not have permission to view this directory or page.

When I tried a static HTML file I got:

The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.

(This should have been served by the .NET Core static middleware.)

I'd been playing with my Azure Pipelines YAML and it was pushing the wrong files up in the deploy to Azure Web App task step, thing.

My app is .NET Core 2.2 in "Run-from-Zip" mode, now called Run-from-Package.

A path error in my YAML meant the package contained another subfolder with the package inside it, instead of it all being in the root of the package, if that makes sense.

Maybe this fascinating story helps someone.