Setting up a File Share for the new Azure File Service

rwagg-white small

Rob Waggoner


I’m excited about the Preview of the Microsoft Azure File Server and today and I want show you how I got it working.  I am using a test account, so I will share all of the details with you as I set this up.  And yes this storage account was deleted before I posted this blog.

I want to start by pointing you to this blog that gives you all the detail on the Microsoft Azure File Service, I will make multiple references to this blog because it is a wealth of information.  This post will talk about how I boiled down the information in the blog to connect my Azure VMs to this Azure File Server.

Now down to the detail.  I’m assuming you already have an Azure account setup and I’ll move directly into setting up the storage account. 

First you need to setup a Storage account in Azure. 

image Your storage account name must be all lower case and only contains letters and numbers.


  1. During the Preview, existing storage accounts do not have access to Azure Files, so you need to create a new storage account.
  2. Once your share is created, it can be accessed via the SMB or REST protocol from any Azure node (VM/Worker/Web role) hosted in the same region as the storage account hosting the share. 
  3. Since this share is only accessible to the Azure workloads in the same region, I put my storage account in the same affinity group as the Virtual Network that contains the VMs that will be accessing the share.  This ensures that the storage account is always available to my Azure workloads (VMs) that need the share.  Remember the geographical limit here is the region, so any VMs within the same region should be able to access this share as well.

Second, Now that I’ve setup the storage account, we now need to configure access to it.  First take a look at the Storage Account dashboard and it will show you the access points for your new storage account.  Notice the added line of Files (in Preview).


Third, the first two steps have been easy via the User Interface, now we will have to use a bit of PowerShell.  We need to make sure PowerShell and the new Azure File Share CmdLets are installed.  If you need to install PowerShell, you can install it from here.  Once PowerShell is installed, you need to install the CmdLets for Azure File Share here, be sure to read FAQ.7 on how to install the File Share CmdLets. 

Fourth, now on to the actual connection.  We setup the actual file share via PowerShell.  The article I’m referencing covers other ways to access the File Share, but I’m just going to talk about PowerShell here.  Below is a screen shot of my Azure PowerShell screen executing the PowerShell commands to setup this share.  Don’t worry, I’ll give you more detail below, but I wanted to make sure you saw EVERYTHING.  I don’t like it when I have to figure out the “little details”, so I wanted to show you verbatim what happened.  And yes, I deleted this storage account before I published this blog.


Before we can actually use the File Share capabilities, we need to import the module for Azure File Shares, and then point to the new storage account we created.  Remember when I told you I was sharing all of the “little details”?  The third line of my PowerShell sample, the one  that starts with $ctx=, contains my Azure Storage Account Name ‘azurefilesharedemo’ and then the Access Key for my azure storage account.  Hint: the name of your share needs to be all lower case. 

# import module and create a context for account and key
import-module .\AzureStorageFile.psd1
$ctx=New-AzureStorageContext 'azurefilesharedemo' 'wB9Rld+X/iDeHXdRgjxDaX8ePLyY8z0KusM8Qo2VAQPHAztNRN8/J19hNc7kBFKjNnVjbFqniI5KCiBjLCvm6g=='

You can access your Storage Account Name and Access Key from the MANAGE ACCESS KEYS icon at the bottom of the dashboard for your storage account. 


Fifth, Now we have identified our Azure share and the credentials, the command below will tell PowerShell to create the share and storage. 

# create a new share
$s = New-AzureStorageShare 'newshare' -Context $ctx
# create a directory in the test share just created
New-AzureStorageDirectory -Share $s -Path testdir

Now we’ve setup the storage and am able to connect to your storage (using a net share) from your Virtual Machines.  Here is the actual net use command I used to connect to my new storage.

net use * \\\demofileshare1 /u:azuredemoshare GgMyRwNO4ay/WhraF459AYDCKV99JTlybjItMRA5y5Ijeds8VNULLXLLS/sWH/fkVYmH3OODznusCL9zhTzI0g==

Here is the screen shot of the actual net use command and a directory of my new share.  I went ahead and created the TestMe directory and hello.txt file so I’d have something to show you.


Now, remember that this connection is only supported from with the Azure Region because we are using SMB 2.1.  I wasn’t able to connect to this share from my local machine, but I could connect to it from multiple VMs with my Azure account.  If you need global access to this share, you have to use the REST API, which is also discussed in the article I referenced. 

(June 12, 2014) I wanted to share some updated information around Azure File Shares.  As I mentioned, you can access the File Share from any VM within the same Region of your File Share, but you cannot access the File Share from on-premises resources connected via a Virtual Network unless you are using ExpressRoute.  According to my teammate Todd Sweetser, ExpressRoute opens up this new File Share capability to your ExpressRoute connections as well as your VMs located in the same Region.

Finally, now you have a drive letter mapped to a 5TB file share within Microsoft Azure.  I will use a share like this to store my installation files and other items that will be leveraged by more than one VM.  Also remember that multiple VMs can connect to this share at the same time.

Until next time,


Comments (21)
  1. Anonymous says:

    Pingback from NeWay Technologies – Weekly Newsletter #99 – June 12, 2014 | NeWay

  2. Anonymous says:

    Pingback from Weekly IT Newsletter – June 9-13, 2014 | Just a Lync Guy

  3. Anonymous says:

    Pingback from Weekly IT Newsletter – June 9-13, 2014 | Just a Lync Guy

  4. rwadnal says:

    I have the file share created and I am able to map the share on 2 of my VM’s. I have to be logged on for the servers to see the map drive. Is there a way to have the shares mapped without having a user log on? My goal is to have a group of web servers use the
    share, but not have any user logged on. Is this even possible? I have posted questions on MSDN, but so far no answers.

  5. jay says:

    I have created the file share and have attempted to use the net use * \ /u:azuredemoshare GgMyRwNO4ay/WhraF459AYDCKV99JTlybjItMRA5y5Ijeds8VNULLXLLS/sWH/fkVYmH3OODznusCL9zhTzI0g== with updated account
    details but I am getting syntax error on PS

  6. richarde says:

    Does anyone know whether it will be possible in future to map Azure Files on a local machine connected via a VPN not using ExpressRoute?

  7. Pauls says:

    @rob and jay, did you get a response to your questions? We have similar need as well.



  8. Paddy says:

    hi, I’ve tried to create a Storage Account in the Portal Preview, but I don’t see the Files (Preview) being displayed in the portal… Am I missing a step?

  9. rahul says:

    @Paddy, you have to enable Files (preview) service to be able to use it. Once enabled, any new storage account you add will have this feature for you to use. Good Luck.

  10. Vinny says:

    Hi, is there a way in hybrid scenario to mount the mapped drive as a network drive accessible by machines not in azure but in our network?

  11. Christian says:

    I am wondering about tha same thing as Vinny. Is it possible to map the network drive directly on my computer?

  12. deniz says:

    is it possible to create multiple 5TB shares and map them all from the same vm?

  13. Anonymous says:

      Right now, I’m studying for the Developing Microsoft Azure Solutions , Microsoft Exam 70-532.

  14. pratush says:

    I am trying to do this for sometime, and am consistently getting ‘specified network name is no longer available’ system error 64.
    Trying this over an azure hosted IAAS VM on the same region as the storage account. Could it be firewalled? any specific ports needs to be opened..

  15. pratush says:

    Oh k. My VM was in a different region 🙁 and hence the error.
    Great article. Thanks for sharing!

  16. Access Azure File Service via VPN says:

    So it seems there is no way to access the Azure File Service via a VPN link. This limitation is because the IP network for the Azure File Service is outside of the subscriptions virtual network address space. This means you cannot include the Azure File
    Service IP network within the VPN tunnel into the on-premise network.
    Are there any plans to change the Azure File Service to support access via a VPN?

  17. DRS says:

    Any updates on if Azure File Service is going to be opened up so that it supports on premise via VPN. I was really looking forward to that functionality so I didn’t have to buy 3rd Party apps like Cloudberry Drive to simulate that functionality

  18. Allan M says:

    Hey Rob, thank you for great article 🙂 I have been playing around with this new service and is a bit sad that file shares only is accessible from VM within same region (in azure cloud, is this still true?) you mentioned that this is possible using express
    route, but havnt been able to confirm this do you have any documentation regarding this?

  19. jsykes says:

    I think there is a growing need for these file shares to be accessible from OnPrem over VPN/ExpressRoute connections (see previous responses). I think this would be a great solution for customers assuming storage limits (5TB) are increased and VPN/non
    internet based connectivity to the share (for on-prem users/apps) is present.

  20. Ga-Hsin says:

    Can Azure file storage replace a on premise file share that users access through mapped network drives?

    1. I’ve just been having a play with this – a proper SMB remote drive is what seems to be missing from 365 (Don’t get me started on onedrive!).. have been able to get a connection to it from a client PC, but am confused as to why I have to authenticate using the fileshare account name and a key. Why can’t I authentication using my 365 account name and password? Am I missing something.?

Comments are closed.

Skip to main content