简体   繁体   中英

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

I have an Azure Web app. 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.

Description: An unhandled exception occurred during the execution of the current web request. 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.

ASP.NET is not authorized to access the requested resource. Consider granting access rights to the resource to the ASP.NET request identity. 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. If the application is impersonating via , the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.


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. I have access to the following tools:

  • IIS remote manager
  • The new Azure portal (which has a sandbox command console)
  • 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.

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存储中,因为这可能会导致IIS站点重新启动

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM