简体   繁体   English

Microsoft Azure Web App-未授权ASP.NET访问所请求的资源

[英]Microsoft Azure Web App - ASP.NET is not authorized to access the requested resource

I have an Azure Web app. 我有一个Azure Web应用程序。 Up until a few days ago I had a simple file upload form that worked well. 直到几天前,我还拥有一个简单的文件上传表格,效果很好。

About a week ago, it started causing the following error: 大约一周前,它开始引起以下错误:


Access to the path 'D:\\home\\site\\wwwroot\\Accounts\\XXX\\test.sqlite' is denied. 拒绝访问路径“ D:\\ home \\ site \\ wwwroot \\ Accounts \\ XXX \\ test.sqlite”。

Description: An unhandled exception occurred during the execution of the current web request. 说明:执行当前Web请求期间发生未处理的异常。 Please review the stack trace for more information about the error and where it originated in the code. 请查看堆栈跟踪,以获取有关错误及其在代码中起源的更多信息。

Exception Details: System.UnauthorizedAccessException: Access to the path 'D:\\home\\site\\wwwroot\\Accounts\\XXX\\test.sqlite' is denied. 异常详细信息:System.UnauthorizedAccessException:拒绝访问路径“ D:\\ home \\ site \\ wwwroot \\ Accounts \\ XXX \\ test.sqlite”。

ASP.NET is not authorized to access the requested resource. 没有授权ASP.NET访问请求的资源。 Consider granting access rights to the resource to the ASP.NET request identity. 考虑将资源的访问权限授予ASP.NET请求标识。 ASP.NET has a base process identity (typically {MACHINE}\\ASPNET on IIS 5 or Network Service on IIS 6 and IIS 7, and the configured application pool identity on IIS 7.5) that is used if the application is not impersonating. ASP.NET具有一个基本进程标识(在IIS 5上通常为{MACHINE} \\ ASPNET或在IIS 6和IIS 7上为Network Service,在IIS 7.5上通常是配置的应用程序池标识),如果应用程序没有模拟,则使用该标识。 If the application is impersonating via , the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user. 如果应用程序通过进行模拟,则身份将是匿名用户(通常为IUSR_MACHINENAME)或经过身份验证的请求用户。


I know if this was running on my local machine or more traditional hosting provider, I could right click on the folder and manage the permissions. 我知道这是在本地计算机上还是在传统的托管服务提供商上运行,我可以右键单击该文件夹并管理权限。

But I have a hosted Azure web app. 但是我有一个托管的Azure Web应用程序。 I have access to the following tools: 我可以使用以下工具:

  • IIS remote manager IIS远程管理器
  • The new Azure portal (which has a sandbox command console) 新的Azure门户(具有沙箱命令控制台)
  • FTP FTP

How can I resolve this? 我该如何解决? I should note that I tried redeploying the source code to another Azure web instance... and the form worked fine!- for about 2 days and then started returning the same error. 我应该注意,我尝试将源代码重新部署到另一个Azure Web实例...,并且该表单运行良好!-大约2天,然后开始返回相同的错误。

A really basic tutorial would be much appreciated, maybe even with screenshots. 真正的基础教程将不胜感激,甚至连屏幕截图也是如此。 I see this question being asked quite a bit with no resolve for sites running as an Azure Web App. 我看到这个问题被问了很多,对于作为Azure Web App运行的网站没有任何解决方法。

您应该将文件存储在虚拟目录下的Azure存储中,因为这可能会导致IIS站点重新启动

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 没有授权ASP.NET访问SSRS的请求资源 - ASP.NET is not authorized to access the requested resource For SSRS ASP.NET访问临时文件夹时无权访问请求的资源 - ASP.NET is not authorized to access the requested resource when accessing temp folder ASP.NET Web窗体:所请求的资源上不存在“ Access-Control-Allow-Origin”标头 - ASP.NET Web Forms: No 'Access-Control-Allow-Origin' header is present on the requested resource ASP.NET Web应用程序中的授权文件访问 - Authorized File access in ASP.NET Web Application 如何对ASP.NET MVC Web应用程序进行授权的HttpWebRequest - How to make an Authorized HttpWebRequest to an ASP.NET MVC web app 如何在Windows Azure Web App上发布的asp.net网站中访问Web服务 - How to to access web service in asp.net web site whcih publish on windows azure Web App 从asp.net核心身份验证Web应用程序获取Microsoft Graph的访问令牌 - Getting Access Token for Microsoft Graph from asp.net core Authentication web app 将 Azure AD 集成到 ASP.NET Core Web 应用程序时更改默认拒绝访问路径 - Changing default access denied path when integrating Azure AD into an ASP.NET Core web app “请求的资源不支持HTTP方法'PUT'ASP.Net Web API - "The requested resource does not support HTTP method 'PUT' ASP.Net Web API 请求失败,HTTP 状态为 401:已授权从 C# asp.net 访问 sharepoint Web 服务 - The request failed with HTTP status 401: authorized for access sharepoint web service from C# asp.net
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM