Azure File Share Won't Connect

Vijayasimha BR 0 Reputation points
2025-03-08T06:50:19.1266667+00:00

I have created a storage account. Then, I created a file share. And, I am able to upload files to the file share on the Azure Portal.

On the same storage account, I also have a blob with anonymous access and able to access these files outside the portal. Not sure if this makes a difference, but it does show, the storage account is in good shape.

Next, I am trying to map it as a network drive. I am running "Windows Server 2022 Standard Evaluation" "Version 21H2".

I have the correct credentials; I am positive of this. Each time I try to connect, it asks for the username and password (so connection is being made to the file share). Then, it says, cannot connect. I run the troubleshooter; I get the following.

The device or resource (dccomicsmar62025storage.file.core.windows.net) is not set up to accept connections on port "The File and printer sharing (SMB)".

Now, on the windows server PC, I have allowed all File Related Inbound Rules.

User's image

On the Azure Portal, I have already disabled "Secure transfer required".

So, this is where I am. Still, unable to map network drive with the Azure File Share.

Azure Files
Azure Files
An Azure service that offers file shares in the cloud.
1,382 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Vinodh247 29,781 Reputation points MVP
    2025-03-09T05:53:02.09+00:00

    Hi ,

    Thanks for reaching out to Microsoft Q&A.

    It looks like your issue is related to SMB (Server Message Block) connectivity, which is required for Azure File Share. Here are a few steps to troubleshoot and resolve the issue:

    Ensure SMB 3.0 is Enabled

    Azure Files requires SMB 3.0 with encryption enabled. Since you're using Windows Server 2022, it should support it by default, but verify with the following command in PowerShell.

    Check Network Connectivity

    Test-NetConnection -ComputerName <your-storage-account>.file.core.windows.net -Port 445

    • If this fails, your firewall or network provider is blocking outbound connections on port 445.
    • Some ISPs (especially for home networks) block port 445, so you may need to use a VPN or Azure VPN Gateway.

    Ensure Firewall Allows SMB Traffic

    Even though you've allowed file-related inbound rules, double-check that port 445 is open in your Windows Defender Firewall.

    To Manually allow port 445 for outbound traffic:

    New-NetFirewallRule -DisplayName "Allow SMB Outbound" -Direction Outbound -Protocol TCP -LocalPort 445 -Action Allow

    Verify Azure File Share Authentication

    Try accessing Azure Files via PowerShell instead of mapping a drive:

    $storageAccountName = "<your-storage-account>" $storageAccountKey = "<your-storage-account-key>" $shareName = "<your-file-share>" $credential = New-Object -TypeName PSCredential -ArgumentList "Azure$storageAccountName", (ConvertTo-SecureString -String $storageAccountKey -AsPlainText -Force) New-PSDrive -Name Z -PSProvider FileSystem -Root "\$storageAccountName.file.core.windows.net$shareName" -Credential $credential -Persist

    Check If Azure Storage Account is Using Private Endpoint

    • If your storage account is using Private Endpoints, your on-premises network must have proper DNS resolution. If it resolves to a private IP (10.x.x.x or 192.168.x.x), you need a VPN or ExpressRoute to connect.

      nslookup <your-storage-account>.file.core.windows.net

    Try Mapping the Drive Manually

    Instead of the UI, try this in Command Prompt:

    net use Z: \<your-storage-account>.file.core.windows.net<your-share-name> /user:Azure<your-storage-account> <storage-account-key>

    Check Azure Storage Account Configuration

    • Ensure "Secure Transfer Required" is disabled (which you have already done).
    • Ensure the storage account is not behind a VNET or firewall.

    Final Check: ISP or Network Blockage

    • If all else fails and port 445 is blocked, try using Azure File Sync or a VPN to Azure.

    Please feel free to click the 'Upvote' (Thumbs-up) button and 'Accept as Answer'. This helps the community by allowing others with similar queries to easily find the solution.

    0 comments No comments

  2. Eren Chin 20 Reputation points
    2025-03-12T07:26:09.2666667+00:00

    You don't need to manually map the File Share in the Windows Explorer GUI, you can find a PowerShell script including the mount command and required credential of your storage account from Portal-yourSA-yourFileShare-connect page.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.