简体   繁体   English

azure 文件共享访问通过 web 应用程序

[英]azure file share access via web application

C# ASP.NET MVC web application - I followed all the steps from https://blogs.iis.net/davidso/azurefile in order to be able to access my Azure location by unc. C# ASP.NET MVC web application - I followed all the steps from https://blogs.iis.net/davidso/azurefile in order to be able to access my Azure location by unc.

My newly created local user is in the IISUSER Group and has the same username and pwd (storage key).我新创建的本地用户在 IISUSER 组中,并且具有相同的用户名和密码(存储密钥)。

I then created an application in my website using a new APP Pool (integrated) w/said local user.然后,我使用带有本地用户的新应用程序池(集成)在我的网站中创建了一个应用程序。

I ran the caspol command as well.我也运行了 caspol 命令。

The issue I run into is when trying to do a file.SaveAs , I get an error我遇到的问题是尝试执行file.SaveAs时出现错误

Incorrect username or password用户名或密码错误

Server.MapPath({application}) returns the correct unc path but doing a Directory.Exists won't locate the path. Server.MapPath({application})返回正确的 unc 路径,但执行Directory.Exists不会找到路径。

When viewing the "connect as" with specified user in IIS I get no issues, additionally I can access the unc path directly from my local machine with same creds.在 IIS 中以指定用户查看“连接身份”时,我没有遇到任何问题,此外,我可以使用相同的凭据直接从本地计算机访问 unc 路径。

I tried going to the app pool of the application and set the user directly but no change there.我尝试进入应用程序的应用程序池并直接设置用户但没有更改。 Are there changes I need to make on the Website configuration that the application sits in?我需要对应用程序所在的网站配置进行更改吗? Prior to converting this to an application I initially had it configured as a virtual directory and got the same error.在将其转换为应用程序之前,我最初将其配置为虚拟目录并得到了同样的错误。

Set the load user profile to "True" in the application pool:在应用程序池中将加载用户配置文件设置为“True”:

在此处输入图像描述

try to set the azure user in iis anonymous authentication by clicking on the edit:尝试通过单击编辑在 iis 匿名身份验证中设置 azure 用户:

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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