Agni
Agni

Reputation: 448

Not able to access "Azure File Server" through IIS

I have configured an Azure file server and have mapped with network drive (say Z). Now I am able to connect to network drive using C# console application. Also, I am able to read/write into this.

However when I deploy the same application in IIS server, I am not able to access the mapped path.

can anyone please help me out.

Upvotes: 1

Views: 5300

Answers (4)

Mihail Mateev
Mihail Mateev

Reputation: 86

I have the same experience and I solved it:

  1. Create local user which is with the same credentials user / pass like your credentials for Azure File Service
  2. Run your IIS Application pool under this user or impersonate as the user in code before accessing the Azure file share
  3. If you are using ASP.Net application ensure that you are accessing your shared folder as a network adders for example: \uploadfileshare.file.core.windows.net

Upvotes: 7

Mihail Mateev
Mihail Mateev

Reputation: 86

Your user and password should be storage account name and access key ( primary or secondary ) . Azure File Service is still in preview and there are no many features available in the Azure Management Portal.

You can see the File Service Url in the storage dashboard and use account name and access key as user and password.

Hope this can help

Upvotes: 0

Agni
Agni

Reputation: 448

I still do not have any solution for "Azure File Service", however I just implemented a temporary solution using "Azure Virtual Machine" by enabling SMB ports.

Similar to this Blog

Upvotes: 0

Simon W
Simon W

Reputation: 5496

This will be because the IIS Application Pool user knows nothing about your Azure File Service share. This is standard on any IIS setup regardless of whether it is in Azure or not. Microsoft publishes the following advice for traditional Windows-based shares: http://support.microsoft.com/kb/207671.

The bottom line is that your Application Pool user must have access to the share. I suspect on Azure this may be a problem as you no don't use domain logins but must issue a "net use" command and pass an Azure storage account username and access key which you can't configure for an application pool.

Maybe you could try and run it on Application_Start but I'd probably recommend against it.

Upvotes: 0

Related Questions