gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-03 02:21:07 26 4
gpt4 key购买 nike

我尝试将 Blob 存储映射到带有驱动器标签“Azure Blob 存储”的 Z:,但由于某种原因,无法识别该位置。

我收到此异常:

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.

azure

LSTest 表示FOLDER TO MAP 参数

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

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 出站。

您可以在此 thread 中找到一些其他可用选项

关于azure - 无法通过端口 445 访问 Azure 存储帐户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68987252/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com