Dowload zip file from blob with SAS link using azcopy

a 夏天 提交于 2021-01-29 08:45:57

问题


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


回答1:


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'


来源:https://stackoverflow.com/questions/59314596/dowload-zip-file-from-blob-with-sas-link-using-azcopy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!