【问题标题】:How can we mount azure blob storage as a network drive in windows?我们如何在 Windows 中将 azure blob 存储挂载为网络驱动器?
【发布时间】:2021-05-12 21:49:09
【问题描述】:

如何在本地 Windows 中将 azure blob 存储添加为网络驱动器。 有没有办法将 azure blob 挂载为驱动器?

【问题讨论】:

标签: azure azure-blob-storage


【解决方案1】:

只要满足一些先决条件,Azure 文件就支持将驱动器映射到本地和 Azure 托管系统。

查看文档中的说明:https://docs.microsoft.com/en-us/azure/storage/files/storage-how-to-use-files-windows

【讨论】:

  • 这是 Azure 文件共享而不是 Blob 存储
【解决方案2】:

现在,作为文件系统安装的 Blob 存储已在某些网站上作为预览版提供:https://docs.microsoft.com/en-us/azure/storage/blobs/network-file-system-protocol-support-how-to?tabs=windows

【讨论】:

  • 在撰写此答案时,Windows 或 Linux 都可以安装。当前文档建议安装仅适用于 Linux。
【解决方案3】:

没有将 Azure Blob 存储映射为网络驱动器的官方方法。但是您可以使用一些第三方工具,例如CloudBerry Drive for Microsoft Azure(它需要许可证,但您可以使用免费试用版)。这是关于如何配置它的doc,我试过了,它适用于将 azure blob 存储映射为网络驱动器。

另一种选择是使用 azure 文件存储而不是 blob 存储,因为 azure 文件存储确实支持映射为网络驱动器。

【讨论】:

    【解决方案4】:

    使用 Powershell,下面的脚本会将 Blob 存储映射到 Z:驱动器标签为“Azure Blob 存储” 您将需要位置、存储帐户名称和访问密钥。

    $connectTestResult = Test-NetConnection -ComputerName "BLOB STORAGE LOCATION HERE" -Port 445
    if ($connectTestResult.TcpTestSucceeded) {
        # Save the password so the drive will persist on reboot
        cmd.exe /C "cmdkey /add:`"BLOB STORAGE LOCATION HERE`" /user:`"STORAGE ACCOUNT NAME HERE`" /pass:`"ACCESS KEY HERE`""
        # Mount the drive
        New-PSDrive -Name Z -PSProvider FileSystem -Root "\\BLOB STORAGE LOCATION HERE\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('Z:').Self.Name = 'Azure Blob Storage'
    

    【讨论】:

    • 嗨,我正在尝试运行此命令,但不确定我必须填写的位应该是什么样子;例如:Blob 存储位置是什么样的?你能重新排列引号吗?不确定应该先使用哪个。非常感谢
    【解决方案5】:

    根据您对用例的问题,我认为您应该共享文件而不是 blob。您将获得连接驱动器的 url 和密钥。然后您可以将其映射为系统中的网络驱动器。

    【讨论】:

      猜你喜欢
      • 2018-11-27
      • 2017-08-30
      • 1970-01-01
      • 2012-11-30
      • 2019-11-21
      • 1970-01-01
      • 2018-04-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多