无法通过端口 445 访问 Azure 存储帐户

Unable to reach the Azure storage account via port 445

我正在尝试将 blob 存储映射到 Z:,驱动器标签为“Azure Blob 存储”,但由于某种原因无法识别该位置?

我遇到了这个异常:

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.

LSTest表示FOLDER TO MAP参数

我做的第一件事是 telnet 查看端口是否打开:

 C:\Windows\system32>telnet https://analyticsdev.blob.core.windows.net/ 445
 Connecting To https://analyticsdev.blob.core.windows.net/...Could not open connection to the host, on port 445: Connect failed

我也做了nslookup,但显然没有找到存储位置

根据我的屏幕截图,它明明存在,怎么没找到?

还使用地址+端口远程登录:

 C:\Windows\system32>nslookup https://analyticsdev.blob.core.windows.net/
 Server:  XXXXX.attlocal.net
 Address:  2600:...::1
    
 *** XXXXX.attlocal.net can't find https://analyticsdev.blob.core.windows.net/: Non-existent domain

这是我的脚本:

#set default values
if(!$BLOB_STORAGE_LOCATION) {
    $BLOB_STORAGE_LOCATION = "https://analyticsdev.blob.core.windows.net/"
}
if(!$STORAGE_ACCOUNT_NAME) {
    $STORAGE_ACCOUNT_NAME = "analyticsdev"
}
if(!$ACCESS_KEY) {
    $ACCESS_KEY = "2*********************="
}
if(!$FOLDER_TO_MAP) {
    $FOLDER_TO_MAP = "LSTest"
}
if(!$DRIVE_LETTER) {
    $DRIVE_LETTER = "Z"
}
if(!$DRIVE_LABEL) {
    $DRIVE_LABEL = "Azure Blob Storage"
}

<#
Author: Hadi Nasser
Purpose: This script will map a Blob Storage as network drive
#>

$connectTestResult = Test-NetConnection -ComputerName $BLOB_STORAGE_LOCATION -Port 445

if ($connectTestResult.TcpTestSucceeded) {
    # Save the password so the drive will persist on reboot
    cmd.exe /C "cmdkey /add:`"$BLOB_STORAGE_LOCATION`" /user:`"$STORAGE_ACCOUNT_NAME`" /pass:`"$ACCESS_KEY`""
    # Mount the drive
    New-PSDrive -Name $DRIVE_LETTER -PSProvider FileSystem -Root "\$BLOB_STORAGE_LOCATION$FOLDER_TO_MAP" -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."
}

(New-Object -ComObject Shell.Application).NameSpace("$($DRIVE_LETTER):").Self.Name = $DRIVE_LABEL

正如@Gaurav Mantri 在评论部分所建议的那样,您无法装载 blob 容器。您可以挂载文件共享。请检查此 Mount SMB Azure file share on Windows

根据您遇到的错误,您的网络似乎已阻止端口 445。请与您的 IT 部门或 ISP 合作打开端口 445 出站。

您可以在此

中找到一些其他可用的选项