问题描述
我们突然收到此错误 您没有 有权查看此目录或页面 在应用程序上 网址 自从上周以来.
We have suddenly getting this error "You do not have permission to view this directory or page" on app url since last week. All CI/CD are running perfectly related to this app.
推荐答案
这基本上表明Azure在运行Web应用程序时遇到错误.自生产以来,它不会显示任何有用的错误消息.出于测试/调试的目的,您可以打开Azure详细消息传递,并在准备就绪时将其关闭 用于生产.为此,您必须遵循以下两个步骤,
That basically a hint that Azure encountered 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,
- 登录到Azure> App Services(左侧菜单)>
您的 网络应用
>诊断日志(如果找不到它,搜索框位于顶部),然后打开详细 错误消息
或打开所有日志记录选项,由您自己决定. - 现在在您的
网络 配置
文件, - 在您的
网页 配置
文件添加< customErrors 模式=关" />
在system.web结束标记之前,</system.web>
. 类似地,添加< httpErrors errorMode =详细">/lt;/httpErrors>
BEFORE</system.webServer>
. 最后,上传网络 配置
到Azure,然后动动手指.
- Login to Azure > App Services (left side menu) >
Your Web App
> Diagnostics logs (search box is at the top if you can't find it), then turn onDetailed Error Messages
or turn on all of the loging 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 theWeb 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!
这篇关于突然开始获取您没有访问此Web应用程序URL时查看此目录或页面的权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!