Learn How to Mount an SMB Azure File Share in Windows
Tags: azure, cloudcomputing, storage, file
Published: 2023-07-26 13:08:05

In Azure, an "Azure File Share" is an Azure storage service that allows you to create a fully managed file share in the cloud. It provides a shared file storage solution that can be accessed from multiple virtual machines (VMs) and even on-premises systems, making it a suitable option for scenarios where you need to share files between applications and users.

In this article, We will mount an Azure file share in Windows and use it as a regular network drive or map it as a folder on your system using the SMB protocol, making it appear like a local file system.

## Key features of Azure File Share include:

**Fully Managed Service:** Azure File Share is a fully managed service, which means Microsoft takes care of the underlying infrastructure, maintenance, and scaling. As a user, you only need to focus on using the file share without worrying about the backend details.

**SMB Protocol Support:** Azure File Share supports the Server Message Block (SMB) protocol, which is the same protocol used in traditional file shares on Windows systems. This means you can access Azure File Share from Windows, Linux, and macOS systems seamlessly.

**Cross-Platform Access:** Azure File Share can be accessed from anywhere with an internet connection, enabling cross-platform collaboration and sharing between different operating systems and environments.

**Scalable and Elastic:** Azure File Share can grow with your needs. It provides scalable storage, and you can easily increase or decrease the size of the file share as required.

**Snapshots:** Azure File Share supports creating snapshots, allowing you to capture the state of the file share at a specific point in time. This feature is useful for backup and recovery scenarios.

**Integration with Azure AD:** You can use Azure Active Directory (Azure AD) to control access to your Azure File Shares, enabling you to manage permissions for users and groups more effectively.

## Common use cases for Azure File Share include:

- Storing shared application configuration files accessible by multiple VMs.
- Hosting content for web applications to be accessed by multiple instances.
- Sharing files between on-premises environments and Azure VMs.

## Prerequisite
  
To mount an Azure File Share, you need;

1. An [Azure Subscription](https://azure.microsoft.com/en-us/free/?WT.mc_id=azure-azuredevtips-azureappsdev)
2. A [storage account](https://learn.microsoft.com/en-us/azure/storage/common/storage-account-create?WT.mc_id=docs-azuredevtips-azureappsdev&tabs=azure-portal) 
3. A computer running on Windows 10 or later OS. 

## Mount an Azure file share in Windows
We will start by creating the file share we will mount in Windows;

1. Go to the [Azure portal](https://portal.azure.com/) and navigate to your Azure Storage Account.
2. Select the File shares menu.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iol1o01s5avlan7x7p20.png)
3. Click the  + File share button. This opens the New file share blade.
4. Give the File share a Name and click on the Review + create button.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1mjins8k0mc9vde29xbh.png)
5. Once validation is passed Click on Create.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9f2k1dvzbhfdw3v0lcal.png)

When the file share is created it will show you the details of the share

1. Click "Connect" to start connecting the file share to your Windows PC.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r6bfnzl2hlt53srdi4jt.png)
2. The blade is set to Windows by default and you can see the options for Linux and MacOS, In this article we are using windows so leave in default. Name your drive, by default the drive is named "Z" but there are option to choose between the 26 letters of the English Alphabet.
3. Click on "Show Script" and copy the Script.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eurpiiwczdojgad33osm.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/27eba62e325nrtm24jrd.png)
4. Open your Windows Powershell and paste the script.(Note: Make sure your port 445 is open for this to work) 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x3qcn6vbsm2k2p4a1a4h.png)
5. Click the enter button on your keyboard, the script will run and tell you if it has executed successfully or if there is an error, the most common error you might run into is that it can't connect to port 445 because the port 445 is closed, make sure it is accessible.
![The script executed successfully](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4oa1w3vu6d141njywiki.png)
The script executed successfully.
6. Open File Explorer on your PC. You should now see the Files share as a network drive. You can try it out by creating files and folders in it.
![Azure file share is now mounted](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2rgyelj11gmiypw2q580.png)
Azure file share is now mounted as a network drive.

## Conclusion

Azure File Share is a fully managed cloud service in Microsoft and a great way to store your data in the cloud keeping it redundant, secure and available. You can easily use it for your daily storage by mounting it on your operating system. Check it out and come back for more tips on cloud computing.