azure-storage-azcopy: azcopy 10 from blob to file share is not supported

Which version of the AzCopy was used?

10.2.1

Which platform are you using? (ex: Windows, Mac, Linux)

Mac

What command did you run?

end=`date -d "10 minutes" '+%Y-%m-%dT%H:%M:%SZ'`
SOURCE_SAS=$(az storage container generate-sas -n source --account-key "$KEY" --account-name <storage-account-name> --https-only --permissions dlrw --expiry "$end" -otsv)
DESTINATION_SAS=$(az storage share generate-sas -n destination --account-key "$KEY" --account-name <storage-account-name> --https-only --permissions dlrw --expiry "$end" -otsv)

./azcopy cp "https://<storage-account-name>.blob.core.windows.net/source?$SOURCE_SAS" "https://<storage-account-name>.file.core.windows.net/destination?$DESTINATION_SAS" --recursive=true

What problem was encountered?

The following is printed:

“failed to parse user input due to error: the inferred source/destination combination is currently not supported. Please post an issue on Github if support for this scenario is desired”

How can we reproduce the problem in the simplest way?

Try to recursively copy blob directory to file share.

Have you found a mitigation/solution?

No

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 16 (9 by maintainers)

Most upvoted comments

According to the docs, only SAS authentication is supported, both for the source (blob) and destination (file share), and for the file share it can only be generated using the REST API or client libraries.

So to copy the file using az version 2.0.75 in the Azure Cloud Shell, create a SAS token for the destination using:

az storage share generate-sas --account-name {STORAGE_ACCT_NAME} --account-key {STORAGE_ACCT_KEY} --name {FILE_SHARE_NAME} --permissions rwl --expiry 2019-11-01

This will output the SAS token. Then assuming your source file URL already has a SAS token from the Portal (or CLI) azcopy using:

azcopy copy 'https://{STORAGE_ACCT_NAME}.blob.core.windows.net/{CONTAINER_NAME}/{BLOB_NAME}?<source token redacted>' 'https://{STORAGE_ACCT_NAME}.file.core.windows.net/{FILE_SHARE_NAME}?<token from step 1 redacted>'

Version 10.3 is now released, with this feature included.