【问题标题】:Is any way can download file from Azure File(not blob) share by powershell是否可以通过powershell从Azure文件(不是blob)共享中下载文件
【发布时间】:2017-10-06 00:47:15
【问题描述】:

我想通过 powershell 从 Azure 文件存储中下载一个大文件,
我发现所有的解决方案都是使用 Azure blob,它不能使用 Azure 文件,

有什么方法可以从 Azure 文件中下载文件吗?

[注意:因为文件非常大(127GB),下载要花很多时间(可能需要3~4天),所以我用浏览器下载时总是坏掉]

以下为官方文档:https://docs.microsoft.com/en-us/azure/storage/storage-powershell-guide-full

【问题讨论】:

    标签: powershell azure azure-files


    【解决方案1】:

    您可以使用以下 cmdlet 从 Azure 文件共享下载文件。

    $ctx = New-AzureStorageContext [storageaccountname] [storageaccountkey]
    ##sharename is your existed name.
    $s = Get-AzureStorageShare [sharename] –Context $ctx
    ##To download a file from the share to the local computer, use Get-AzureStorageFileContent.
    Get-AzureStorageFileContent –Share $s –Path [path to file on the share] [path on local computer]
    

    如果你想使用一个命令下载多个文件,你可以使用Azcopy

    AzCopy /Source:https://myaccount.file.core.windows.net/myfileshare/ /Dest:C:\myfolder /SourceKey:key /S
    

    更多信息请参考这个link

    【讨论】:

      【解决方案2】:

      你可以通过 3 种方式做到这一点

      1. Azure 存储资源管理器

      在任意窗口安装azure storage explorer,即可下载文件

      2。 AZ复制

      在 powershell 中执行以下命令从 azure blob 下载文件

      在powershell中像这样执行下面的命令

      &'C:\Program Files (x86)\Microsoft SDKs\Azure\AzCopy\AzCopy.exe' /Source:https://<STORAGE-ACCOUNT-NAME>.blob.core.windows.net/test-adf /Dest:'C:\Program Files\Microsoft SQL Server\MSSQL13.SQLEXPRESS\MSSQL\Backup' /SourceKey:<BLOB-KEY> /S /XO
      

      3. Azure 文件服务

      您可以将 Blob 连接为外部驱动器,以便轻松复制文件

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2021-11-10
        • 2020-07-30
        • 1970-01-01
        • 2021-02-22
        • 2021-12-06
        • 2017-08-20
        相关资源
        最近更新 更多