问题
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