Azure Files Preview - Shared Folder Access in IIS and FileZilla

I'm interested in load balancing 2+ Windows virtual machines in Azure. My basic requirement, however, is that the "uploads" folder must be consistent between each virtual machine. The files in this folder are transferred via FTP to our admin users, and then they will need to select these files in the C # MVC web application. Since you can connect via FTP to one virtual machine, but the web connection may be different, the download should be centralized.

It seemed that the new Azure files, currently in Preview, would help, as they allow me to set up a shared drive that each of the virtual machines can access. My thought was that FileZilla Server would allow an FTP connection to this shared β€œdrive” and the web application would gain access to it to display the contents.

I signed up for a preview of Azure Files and set up the resource by persistently displaying it on Drive Z for experimentation. I also created a new user and made sure that they also have a permanent mapping to the same drive as Z.

But I can do nothing with this outside of remote desktop. FileZilla, despite the fact that its service is configured to log in using this new account, will not show the contents of this drive or write nothing. Likewise, my web application cannot access the contents of the file even though you switched Passthrough Authentication to this new account for the virtual folder.

Does anyone know of any way to access this drive through a network path or drive letter? Is this possible with Azure Files? Are there any other solutions for sharing some blocks between virtual machines, but are they considered as a local disk or network resource?

[UPDATE]

This can help. By setting the share and using cmdkey and net use, while the cmd prompt starts a specially created user (as suggested at http://blogs.msdn.com/b/windowsazurestorage/archive/2014/05/27/persisting-connections -to-microsoft-azure-files.aspx ) if I point the virtual folder in IIS to this resource using the specific account created and Test Connection, I get: Test: Authentication (green checkmark; "The specified user credentials are valid") Test : authorization (red cross; "the path does not exist or the environment variables in the path cannot be expanded to check with Does he exist? ")

While still on the runas cmd command line, I can access the resource, so this does not apply to specific permissions. It seems that IIS cannot use this user to access the resource for some reason. The limitation of Azure Files is that I cannot specifically grant any permissions for the folder inside this resource.

+7
azure azure-virtual-machine network-shares
source share
2 answers

What worked for me is this:

  • Create New Account
  • Set the IIS application pool identifier for this specific user.
  • Set the IIS Load User Profile application pool property to true:
  • run cmd promt as this user (runas)
  • do cmdkey and network usage (with /persistent:true switch) as you described
  • Create an IIS virtual directory with the physical path set for the UNC shared path (and not the mapped drive).

A small PowerShell snippet for point 5:

  $ share = "your-storage-account.file.core.windows.net \ yoursharename"
 $ usr = "your-storage-account"
 $ key = "your-storage-key"

 #store credentials for the network share - must be done for the user that will run the app pool
 cmdkey /add:subclub.file.core.windows.net\images / user: $ usr / pass: $ key
 net use z: "\\ $ share" / user: $ usr $ key / persistent: yes
+5
source share

The answers here have been helpful.

Customization

  • Create a new user {appuser}
  • Open the command window as a user

runas / user: {appuser} cmd.exe

  1. In the new window {appuser} cmd use

cmdkey / add: {storage-account} .file.core.windows.net / user: {storage-account} / pass: {account-key}

  1. Define the IIS application pool to use {appuser} 4b. Set LoadUserProfile to true

Note the need to use a network. No mapped drive required.

the code

Now here is the key piece. From your application, you must write the UNC path.

\ {savings account} .file.core.windows.net \

ex.

 File.WriteAllText("\\\\{storage-account}.file.core.windows.net\\share\test.txt", "contents goes here"); 
+4
source share

All Articles