简体   繁体   中英

Azure WebJob DWASFiles access denied

I have 2 Azure websites running (Live and Staging), each with a continuous WebJob that processes documents uploaded to the site. Nothing has been added/changed on the live site for a few weeks. So this issue has come out of the blue entirely.

In the WebJob we read files from App_Data for the website, analyse and store them to a database. No additional file writes take place. Some time in the last week the WebJobs started failing with:

Unhandled Exception: System.UnauthorizedAccessException: Access to the path 'C:\\DWASFiles\\Sites' is denied.

I can't see anyone else who's got a similar issue that's occurred recently. So I'm a little stumped!

My Solution As I couldn't find any resources describing what to do or what had changed in Azure. I went along a different route and extracted the WebJob logic into a Hangfire task. (hangfire.io - a fantastic task runner)

Not sure if that will help anyone else. But it solved my issues.

Try using D:\\home\\site\\wwwroot\\ to point to your wwwroot directory. Azure Websites remaps the root directory to be used with D:\\Home

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