How to Mount an Azure File Share on Windows Server via SMB

The Cloud File Server

Traditionally, enterprise organizations housed massive arrays of hard drives in their local data centers to host shared folders (the Z: drive) for their employees. However, managing the hardware, backups, and physical security for an on-premise file server is expensive and time-consuming.

Microsoft offers a cloud-native alternative: Azure Files. Azure Files provides fully managed file shares in the cloud that are accessible via the industry-standard Server Message Block (SMB) protocol. The beauty of Azure Files is that you do not need to rewrite your legacy applications or re-train your employees. You can simply mount the Azure File Share directly to your local Windows Server (or workstation) as a standard mapped network drive.

To the end-user, the cloud storage looks and acts exactly like a local hard drive.

Step 1: Retrieve the Connection Details

Before you can mount the share, you must retrieve the access keys from the Azure Portal.

  1. Log into the Azure Portal and navigate to your Storage Account.
  2. On the left menu, select File shares.
  3. Click on the specific file share you wish to mount (e.g., corp-data-share).
  4. At the top of the screen, click the Connect button.
  5. A side panel will appear. Select the Windows tab.
  6. Azure will automatically generate a PowerShell script containing your storage account name and the encrypted Access Key. Do not run the script yet; simply copy the Storage Account Name and the Access Key to a secure notepad.

Step 2: Checking Port 445

Because Azure Files uses SMB 3.0 over the public internet, all data is automatically encrypted in transit. However, SMB relies on TCP Port 445. Many ISPs and corporate firewalls aggressively block outbound traffic on Port 445 to prevent the spread of malware.

Before attempting to mount the drive, you must verify that your Windows Server can reach Azure over this port. Open PowerShell and run:

Test-NetConnection -ComputerName "YOUR_ACCOUNT_NAME.file.core.windows.net" -Port 445

If the TcpTestSucceeded result is True, you are cleared to proceed. If it is False, you must open Port 445 on your edge firewall.

Step 3: Storing the Credentials

To mount the drive seamlessly upon every reboot without prompting the user for a password, you must securely inject the Azure Access Key into the Windows Credential Manager.

Open an elevated PowerShell window and execute the following command, replacing the placeholders with your actual Azure details:

cmdkey /add:"YOUR_ACCOUNT_NAME.file.core.windows.net" /user:"AZURE\YOUR_ACCOUNT_NAME" /pass:"YOUR_MASSIVE_ACCESS_KEY_STRING_HERE"

The credentials are now securely stored in the Windows vault.

Step 4: Mounting the Drive

With the credentials secured, you can now map the cloud storage to a local drive letter (e.g., the Z: drive) using the standard New-PSDrive cmdlet.

New-PSDrive -Name Z -PSProvider FileSystem -Root "\\YOUR_ACCOUNT_NAME.file.core.windows.net\corp-data-share" -Persist

The -Persist flag is critical. It ensures that the drive mapping survives a server reboot and appears correctly in Windows File Explorer.

The command executes instantly. If you open File Explorer on the Windows Server, you will see the Z: drive. Any file you drag into that folder is instantly, securely, and transparently uploaded to the Azure cloud.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.