在窗口 azure 门户中,我创建了一个虚拟网络,然后将虚拟机 (X) 和云服务 (Y) 添加到该网络中。
在云服务机器 Y 中,我可以通过窗口资源管理器访问虚拟机 X 中的共享文件夹。
问题是我无法从我的云服务 - Web 应用程序访问该共享文件夹。
返回错误:
Access to the path '\\10.0.1.5\Upload\test.txt' is denied.
Exception Details: System.UnauthorizedAccessException: Access to the path '\\10.0.1.5\Upload\test.txt' 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 <identity impersonate="true"/>, the identity will be the anonymous user (typically IUSR_MACHINENAME) or the authenticated request user.
我确实授予了对该共享文件夹(每个人、网络服务、iis_iusr、...)的完全权限访问权限,但没有运气。
当我使用特定的用户名和密码将模拟身份添加到 web.config 时:
<identity impersonate="true" userName="username" password="pass" />
然后我得到了这个错误:
Could not find file '\\10.0.1.5\Upload\test.txt'.
任何想法?