2013-07-05 88 views
0

在窗口azure門戶中,我創建了一個虛擬網絡,然後將虛擬機(X)和雲服務(Y)添加到那個網絡。窗口Azure虛擬網絡:Asp.net無法從其他虛擬機訪問共享文件夾

在雲服務機器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'. 

任何想法?

回答

0

我解決了這個問題。如上所述的冒充工作得很好。我的錯誤是文件名不小心有重複的分機(test.txt.txt)。