Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
789 views
in Technique[技术] by (71.8m points)

web - Azure website message "You do not have permission to view this directory or page.". What to do?

After I published an ASP.NET Core app to Azure from Visual Studio 2017 I am getting this message when I click on the app url:

enter image description here

It was working fine before. Is there some way to reset the source code or the app?

Do you have any solutions?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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

That basically a hint that Azure encounter an error while running your web app. Since its in production, it does not show any useful error messages. For testing/debugging purposes you can turn on the Azure detailed messaging, and turn back off when its ready for production. To do so, you have to follow these two steps,

  • Login to Azure > App Services (left side menu) > Your Web App > App Service logs (search box is at the top if you can't find it), then turn on Detailed Error Messages or turn on all of the logging options, up to you.
  • Now add the following in your Web Config file,
  • In your Web Config file add <customErrors mode="Off" /> BEFORE system.web closing tag, </system.web>. Similarly, add <httpErrors errorMode="Detailed"></httpErrors> BEFORE </system.webServer>. Finally, upload the Web Config to Azure and cross your fingers.

If you follow the steps correctly, that will show the error messages in detail and hopefully from there you will figure out what went wrong. Good Luck!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...