使用azcopy从blob用SAS链接下载zip文件 [英] Dowload zip file from blob with SAS link using azcopy
问题描述
我尝试使用Powershell中的SAS链接从blob下载一个zip文件.我使用提到的确切语法
如果要从Blob存储下载文件,请参考此.
语法
azcopy复制'https://< storage-account-name>.< blob或dfs> .core.windows.net/<容器名称>/< blob-path>?<; SAS-token>''<本地文件路径>'
示例
azcopy复制'https://mystorageaccount.blob.core.windows.net/mycontainer/myTextFile.txt?<SAS-token>''C:\ myDirectory \ myTextFile.txt'
示例(分层名称空间)
azcopy复制'https://mystorageaccount.dfs.core.windows.net/mycontainer/myTextFile.txt?<SAS令牌>''C:\ myDirectory \ myTextFile.txt'
I try to download a zip file from blob using the SAS link in powershell. I use the exact syntax as mentioned here but I get the below error
failed to perform copy command due to error: cannot use directory as source without --recursive or a trailing wildcard (/*)
Below is the script
.\azcopy.exe copy '<SAS link to file>' '<local file path>'
I use AzCopy version 10.3.3
Your linking article contains example commands that work with Azure Files. However, you mentioned you want to download a zip file from a blob in your question.
I can reproduce this issue when use blob storage but a file path in my Azure files. Please ensure that there is not any typo in your command, especially the blob storage URL and file storage URL.
If you want to download a file from blob storage, please refer to this.
Syntax
azcopy copy 'https://<storage-account-name>.<blob or dfs>.core.windows.net/<container-name>/<blob-path>?<SAS-token>' '<local-file-path>'
Example
azcopy copy 'https://mystorageaccount.blob.core.windows.net/mycontainer/myTextFile.txt?<SAS-token>' 'C:\myDirectory\myTextFile.txt'
Example (hierarchical namespace)
azcopy copy 'https://mystorageaccount.dfs.core.windows.net/mycontainer/myTextFile.txt?<SAS-token>' 'C:\myDirectory\myTextFile.txt'
这篇关于使用azcopy从blob用SAS链接下载zip文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!