azure - 使用 azcopy 从带有 SAS 链接的 blob 下载 zip 文件

标签 azure powershell azure-blob-storage azcopy

我尝试使用 powershell 中的 SAS 链接从 blob 下载 zip 文件。我使用如上所述的确切语法 here但我收到以下错误

failed to perform copy command due to error: cannot use directory as source without --recursive or a trailing wildcard (/*)

下面是脚本

    .\azcopy.exe copy '<SAS link to file>' '<local file path>'

我使用 AzCopy 版本 10.3.3

最佳答案

您的linking article包含使用Azure 文件的示例命令。但是,您提到您想从问题中的 blob 下载 zip 文件。

当我使用 blob 存储但使用 Azure 文件中的文件路径时,我可以重现此问题。请确保您的命令中没有任何拼写错误,尤其是 blob 存储 URL 和文件存储 URL。

enter image description here

如果您想从blob存储下载文件,请引用this .

语法

azcopy copy 'https://<storage-account-name>.<blob or dfs>.core.windows.net/<container-name>/<blob-path>?<SAS-token>' '<local-file-path>'

示例

azcopy copy 'https://mystorageaccount.blob.core.windows.net/mycontainer/myTextFile.txt?<SAS-token>' 'C:\myDirectory\myTextFile.txt'

示例(分层命名空间)

azcopy copy 'https://mystorageaccount.dfs.core.windows.net/mycontainer/myTextFile.txt?<SAS-token>' 'C:\myDirectory\myTextFile.txt'

关于azure - 使用 azcopy 从带有 SAS 链接的 blob 下载 zip 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59314596/

相关文章:

.net - Azure 服务总线队列订阅筛选器更改

java - 如何为 Hive 创建架构以使用 SerDe 解析深度嵌套的 json(Azure Application Insights 输出)?

python - virtualenv v16.7.2 powershell 激活脚本 : "You must ' source' this script: PS> . .\ENV\Scripts\activate”错误

azure - 使用 Azure 托管动态图像的最佳方式

azure - 使用 ADF 复制一组文件

python - 在 PyCharm 中使用 python 发布 azure functionapp

windows - 当角色崩溃或通过管理 API 重新启动时,Azure 角色主机是否实际重新启动?

powershell - 将带有可变部分的消息从 PowerShell 输出到 TeamCity 构建日志

amazon-web-services - 使用 Elastic Beanstalk 在实例启动时运行 Windows Powershell 脚本

对于某些文件,Azure Blob CONTENT-MD 为空