1

Anyone know why the below "net use" command gets varied results depending on the machine OS even though I am logged on as an admin in all cases? Fails or works based on the OS within PowerShell or Cmd whether the shell is run as Administrator or not. The share is setup in Azure File Services and can be accessed on my Win10 machine just fine using Azure PowerShell cmdlets.

# mount azure share as a drive
net use x: \\[myaccount].file.core.windows.net\davesdata /user:[myaccount] [my secondary key]
  • Runs fine on Server 2012
  • Gets “access denied” on Server 2008
  • Gets “path not found” on Windows 10
Dave
  • 1,822
  • 2
  • 27
  • 36

3 Answers3

2

To map a drive to Azure File Storage from on-prem/outside the Azure region hosting it you need SMB 3.0 which comes with Windows 8/2012 or higher. For a machine inside Azure on the same Azure region you need SMB 2.0 or higher which comes with Windows 7/2008 or higher.

Definitely works on Windows 10 using the syntax you showed, double check for typos in the path/key or more detailed error messages in the event log. The mapped drive won't survive a reboot unless you persist the credentials.

cmdkey /add:storage_account_name.file.core.windows.net /user:storage_account_name /pass:storage_account_key

Francois
  • 873
  • 1
  • 8
  • 17
  • I understand about Server 2008. I run the exact same command on Win10 and Server 2012. I turned off the Win10 firewall but no help. Can you think of any reason why Win10 may not work? Server 2012 is at our hosting provider and Win10 behind my home ASUS AC1900 router. One thought is that Win10 chokes on the fact that there is a / char in the secondary password. I have tried persisting with cmdkey as well but also no help. Thx – Dave Jan 09 '16 at 16:26
  • I don't think it is the / char though since the same cmd works on Server 2012 in PowerShell or Cmd. I have tried Cmd and PowerShell, admin and not admin, and works in Server 2012 in all 4 cases and always fails on WIn10 in all 4 cases. – Dave Jan 09 '16 at 16:37
  • It could be the port, SMB needs port 445 make sure that port is open and not blocked by your ISP/firewall. – Francois Jan 10 '16 at 05:42
  • I have file and printer sharing turned on for all networks, and further enabled the pre-defined rule for SMB-IN setup for TCP for System also for all remote IP rather than just local subnet. Still, even turning the Windows firewall completely off on all networks did not help. Are you suggesting I need to open 445 port forwarding in my router to my Win10 machine even though the Azure SMB connection initiates from my Win10 machine? Thx – Dave Jan 10 '16 at 14:35
  • I am an SMB client to Azure. Are you saying I need to unblock port 445 on my side? Thx – Dave Feb 04 '16 at 19:13
  • You don't have to open port 445 for forwarding but make sure it is not blocked by the windows firewall, anti-virus software with built-in firewall, the firewall on your router/modem or in this case it does look like your ISP is blocking the port based on the link you supplied. I usually test if my ISP is blocking a port by using VPN or tethering from my mobile/3G on the machine with the problem. – Francois Feb 05 '16 at 00:11
  • Thx Francois. This fails with the FW down so am pretty sure it is AT&T blocking outbound 445 with U-Verse even though a business account. May I ask how you manage to test with VPN? – Dave Feb 05 '16 at 13:15
2

Azure File Storage supports the following Windows / SMB variants: Windows 7 SMB 2.1, Windows Server 2008 R2 SMB 2.1, Windows 8 SMB 3.0, Windows Server 2012 SMB 3.0, Windows Server 2012 R2 SMB 3.0 and Windows 10 SMB 3.0.

If you are connecting from a VM within the same Azure region you can connect using SMB 2.1 or SMB 3.0. If you are connecting from outside of the Azure region you need to ensure that Port 445 outbound is open. Many ISP's / corporate filewalls will block this. This wiki contains a list of ISP's that allow / disallow Port 445.

Jason Hogg - MSFT
  • 1,369
  • 9
  • 10
  • I'm behind AT&T U-Verse at home. Amazing they block my outbound traffic! May be the same issue at the office where we use Charter cable and can also not connect. Apparently our hosting provider does not block at least and our servers can use the share outside of Azure. I'll have to call AT&T and Charter to see if they would unblock! Thx – Dave Jan 11 '16 at 22:51
  • I wish I could find someone at AT&T that had a clue about anything. They keep wanting me to turn off my firewall etc. to open 445 outbound. Do you know for a fact that U-Verse blocks 445 outbound somewhere in their network and not in the U-Verse modem? And that somehow AT&T can not block outbound ports? I'm also presuming that SMB access works with NAT if I originate the session, and that I do NOT need to open any inbound ports? Thx – Dave Jan 12 '16 at 19:10
0

Port 445 was open on my router. It took me some time to find an additional option in the router: Netbios must be set to "allowed". Then, Windows 10 works fine for me.

Fried
  • 1,323
  • 12
  • 21
  • Thx. My RT-AC68U with ASUSWRT has network filters turned off so I see nothing blocking NETBIOS which is enabled on the enet nics. – Dave Mar 17 '16 at 14:01