question

PGS-7643 avatar image
0 Votes"
PGS-7643 asked JoshuaThompson-9840 answered

Azure Files Mount - Azure VM(domain joined) Network path not found issue

Hi, We have provisioned Azure Windows (2019) VM in our virtual network and the VM is domain joined. We created a storage account and want to mount this Azure Files storage to this VM in Azure. But we are getting error - network path found. We are using storageaccount key to connect to VM
But if we remove the Azure VM from company domain, we are able to mount the fileshare without any issue using the same script.

Below is the mount script & error log -
Command
$connectTestResult = Test-NetConnection -ComputerName myfileshare.file.core.windows.net -Port 445
if ($connectTestResult.TcpTestSucceeded) {
# Save the password so the drive will persist on reboot
cmd.exe /C "cmdkey /add:`"myfileshare.file.core.windows.net`" /user:`"Azure\myfileshare`" /pass:`"+vvvvvvvvvvvvvvvvvvvvvvvvv==`""
# Mount the drive
New-PSDrive -Name Y -PSProvider FileSystem -Root "\\myfileshare.file.core.windows.net\fileshare" -Persist
} else {
Write-Error -Message "Unable to reach the Azure storage account via port 445. Check to make sure your organization or ISP is not blocking port 445, or use Azure P2S VPN, Azure S2S VPN, or Express Route to tunnel SMB traffic over a different port."
}


Error
CMDKEY: Credential added successfully.
New-PSDrive : The network path was not found
At line:6 char:5
+ New-PSDrive -Name Y -PSProvider FileSystem -Root "\\capturefilesh ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (Y:PSDriveInfo) [New-PSDrive], Win32Exception
+ FullyQualifiedErrorId : CouldNotMapNetworkDrive,Microsoft.PowerShell.Commands.NewPSDriveCommand


azure-active-directoryazure-virtual-machinesazure-virtual-networkazure-files
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

deherman-MSFT avatar image
0 Votes"
deherman-MSFT answered

@PGS-7643
Since the issue only happens when the VM is domain joined I suspect a possible DNS issue. Are you able to resolve the storage endpoint when the VM is domain joined. If this is the issue you might look into setting up DNS forwarding. I recommend running the AzFileDisagnostics tool to see what it finds. You can also find more information in our troubleshooting guide.

Hope this helps. If you are still facing issues or have further questions please let us know.



Please don’t forget to "Accept the answer" and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

JoshuaThompson-9840 avatar image
0 Votes"
JoshuaThompson-9840 answered

@PGS-7643 Did you ever get this one figured out?

I am having the exact same issue.
Azure VM joined to domain via site to site VPN, trying to connect to Azure file share directly from the Azure VM. Same error

The first part of the powershell command succeeds:
Test-NetConnection -ComputerName myfileshare.file.core.windows.net -Port 445

ComputerName : (myfileshare).file.core.windows.net
RemoteAddress : 20.60.14.200
RemotePort : 445
InterfaceAlias : Ethernet
SourceAddress : 10.0.0.4
TcpTestSucceeded : True

That 'test-NetConnection' output shows that the hostname is resolving properly.

The powershell script is erroring out on line 6:
New-PSDrive -Name Z -PSProvider FileSystem -Root "\(storage account name).file.core.windows.net(file share name)" -Persist

"The network path was not found.)

Any advice?

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

JoshuaThompson-9840 avatar image
1 Vote"
JoshuaThompson-9840 answered

For anybody else having this problem, here was how I resolved my issue.
I downloaded AzDiagnostics.ps1 from git hub and ran it against my storage account/fileshare on my Azure VM
Instructions here on how to download:
https://github.com/Azure-Samples/azure-files-samples/tree/master/AzFileDiagnostics/Windows

Download the zip and look for the AzFileDiagnostics.ps1 file located in "azure-files-samples-master\azure-files-samples-master\AzFileDiagnostics\Windows"

I then ran:
.\AzFileDiagnostics.ps1 -UNCPath \\storageaccountname.file.core.windows.net\sharename

The output showed me my LmCompatibility Level in "Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa" was set to 1. It stated it needed to be 3 or mounting shares would fail.

I changed to 3 and reran the map drive power shell script. Boom! All good now.

Also found the below on MS docs. Great info
https://docs.microsoft.com/en-us/answers/questions/727502/azure-file-share-mount-issue.html




5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.