Mount Azure File Share From An On Premise 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 a 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. 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 machine as if they are your local directory.

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

Log into 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).


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



Copy the highlighted command in the above screenshot and run the same in your command prompt (or wherever you would like to create the File Share).

Hold on! You need to grab your Access Keys. Access Keys are a way to allow the access to someone in order 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.


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>>


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

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.


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.


Similar Articles