TIP
🔥 Checkout the Azure Developer page at azure.com/developer (opens new window).
💡 Learn more : Azure Files overview (opens new window).
📺 Watch the video : How to mount an Azure Files share in Windows (opens new window).
# How to mount an Azure Files share in Windows
# Files at scale in the cloud
Azure Files (opens new window) is part of the Azure Storage (opens new window) offering, and provides a secure and performant place to store and share files. It works just like a file folder. You can scale it to your needs, and make it as performant and redundant as you need. You can also use Azure Files as a file share that you mount in your operating system.
In this post, we'll mount an Azure Files share in Windows and use it as a regular network drive.
# Prerequisites
If you want to follow along, you'll need the following:
- An Azure subscription (If you don't have an Azure subscription, create a free account (opens new window) before you begin)
- An Azure Storage Account. Create one using a quickstart (opens new window)
- A computer running Windows 10 or later
# Mount an Azure Files share
We'll start by creating an Azure Files share, which we'll mount in Windows.
- Go to the Azure portal (opens new window) and navigate to your Azure Storage Account
- Select the File shares menu
- Click the button + File share. This opens the New file share blade
- Give the File share a Name
- Click Create
(Create an Azure Files share in the Azure portal)
When the Files share is created, click on it. This will show the details of the share, including its directories and files.
- Click Connect to start connecting the Files share
- By default, the blade is set to Windows, which is what we need to mount the share to Windows. Leave the settings as they are and copy the script
(Connect an Azure Files share)
- Open Notepad and paste the script in it
- Save the file as mount.ps1
- Open a PowerShell prompt
- Run the script with something like the code below (change the path to where you saved the file):
d:\mount.ps1
- The script will now try to connect to the Azure Files share and mount it to your computer. It will let you know if it runs into trouble. The most common error is that it can't connect to the Files share, because port 445 is closed. Make sure that port 445 is accessible
- The script will tell you that it executed successfully. The script also saved your credentials in your computer, so that it will automatically reconnect to the Files share when you restart the computer
(The script executed successfully)
- Open File Explorer. You should now see the Files share as a network drive. You can try it out by creating files and folders in it
(Azure Files share is now mounted as a network drive)
# Conclusion
Azure Files (opens new window) is a great way to store your data in the cloud, and keep it secure, redundant and performant. And by mounting an Azure Files share to your operating system, you can easily use it as your daily storage. Go and check it out!