[英]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. 我有2个Azure网站正在运行(实时和暂存),每个网站都有一个连续的WebJob,用于处理上载到该站点的文档。 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. 在WebJob中,我们从App_Data中读取网站的文件,对其进行分析并将其存储到数据库中。 No additional file writes take place.
不会进行其他文件写入。 Some time in the last week the WebJobs started failing with:
上周的某个时间,WebJobs开始失败,原因是:
Unhandled Exception: System.UnauthorizedAccessException: Access to the path 'C:\\DWASFiles\\Sites' is denied.
未处理的异常:System.UnauthorizedAccessException:拒绝访问路径“ C:\\ DWASFiles \\ Sites”。
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. 我的解决方案因为找不到任何资源来描述在Azure中要做什么或发生了什么变化。 I went along a different route and extracted the WebJob logic into a Hangfire task.
我走了另一条路,将WebJob逻辑提取到Hangfire任务中。 (hangfire.io - a fantastic task runner)
(hangfire.io-出色的任务运行器)
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. 尝试使用D:\\ home \\ site \\ wwwroot \\指向您的wwwroot目录。 Azure Websites remaps the root directory to be used with D:\\Home
Azure网站重新映射要与D:\\ Home一起使用的根目录
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.