In this article we will learn how to Mount an Azure File Share from a Virtual Machine.

Please go through the following articles to understand more about Azure File Share.

Introduction:

You could use Azure File Storage for many reasons. Below are few of them.

  • You don’t want to maintain File Servers on your own data centers.
  • You would like to have secured, high available and scalable solution for your File storage needs.

Let’s say, you have multiple administrators or multiple applications that act as a Source for generating files and store them in your Azure File Storage and you would like to have a copy of all those files in one of our Virtual Machines or your personal computer for many different reasons. One of the ways to handle those cases is to mount a File Share on your Windows machines as if they are your local directory.

Let’s see how to create one in this article.

Login to your Azure Subscription and navigate to your File Share that you have created (by following the steps mentioned in one of our previous articles Azure Storage – File Share).

1_fileshare

As shown in the above screen capture, click on Connect button which will open the following Connect blade.

2_connect

Copy the highlighted command in the above screen capture and run the same in your command prompt (or where ever you would like to create the File Share)

Hold on! You need to grab your Access Keys. Access Keys are a way you allow access to someone to connect to your Storage account.

Click on the View access keys for this storage account to navigate to the following blade where you can copy the access keys.

3_accesskeys

Click on the Copy button highlighted in the above screen capture and run the following command in your cmd prompt as shown below.

net use Z: \\<<Storage Name here>>.file.core.windows.net\samplefileshare /u:<<Storage Account Name here>>  <<Access Key here>>

5_cmdprompt

Below is the File Share that got created in my Virtual Machine after running the above command.

6_fileshare

I was also able to see the Directories (see below screen capture) that I have created in our previous article Azure File Storage Add Directory and Upload Files

7_directories

That’s it. We have mounted a file share from Azure to a Virtual Machine.

Summary: In the article, we have learnt the following.

  • How to use Storage Account Access Key
  • Mount a File Share in a Virtual Machine

Hope you enjoyed reading the article. Your feedback is appreciated.