10.2.1
Mac
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
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"
Try to recursively copy blob directory to file share.
No
Hi @dror-weiss, thanks for reaching out!
We have this item in our backlog and will try to schedule it as soon as possible.
I am under impression that no cloud-cloud scenarios are supported.
When can we expect this?
This is not the case. Blob to Blob and S3 to Blob are supported scenarios at the moment. We don't have an exact date on (Files, S3, Blob)-to-files support quite yet as far as I know.
I'm currently working on File/Blob -> File support.
@zezha-msft Can you please set milestone if/when known if this will be in 10.3
Version 10.3 is now released, with this feature included.
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:
1.
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>'
Sorry to pick up this stale issue but for me it's extremely relevant:
I can't seem to wrap my mind about what is the permission needed on a service-principal account for azcopy to work using only the SAS keys => no luck, having the service principal as contributor, storage blob contributer .... everything except owner is not working and owner is not an option
i constantly get
failed to perform copy command due to error: cannot start job due to error: cannot list blobs. Failed with error -> github.com/Azure/azure-storage-blob-go/azblob.newStorageError, /home/vsts/go/pkg/mod/github.com/!azure/[email protected]/azblob/zc_storage_error.go:42
@adreed-msft Can you take a look at this pls?
Any updates on this?
Even I'm getting same error while I transfer between Container to File share.
Exactly which error is that?
same issue here, can't copy from blob to file share. When source is blob and destination is file share, error says can't find container means when source is blob, destination will be expected blob as well. When this feature will be supported?
Which version of AzCopy are you using @yuanman2016 ?
thanks for following up John. My azcopy version is : AzCopy 10.4.3
@adreed-msft What do you think?
any update on this?
Using version 10.5.1 and getting same error as @one-random-dev
$context = New-AzStorageContext -StorageAccountName $storageAccount -StorageAccountKey $storageAccountKey
$sourceSAS = New-AzStorageShareSASToken -Context $context -ExpiryTime (Get-Date).AddHours(24*3) -Permission "rdw" -ShareName "tomigration" -FullUri
$destSAS = New-AzStorageContainerSASToken -Context $context -ExpiryTime (Get-Date).AddHours(24*3) -Permission "rdw" -Name "toarchive" -FullUri
azcopy.exe copy $sourceSAS $destSAS --recursive=true
and getting this error:
`INFO: Scanning...
INFO: Failed to create one or more destination container(s). Your transfers may still succeed if the container already exists.
INFO: Any empty folders will not be processed, because source and/or destination doesn't have full folder support
failed to perform copy command due to error: cannot start job due to error: cannot list files due to reason -> github.com/Azure/azure-storage-blob-go/azblob.newStorageError, /home/vsts/go/pkg/mod/github.com/!azure/[email protected]/azblob/zc_stor
age_error.go:42
===== RESPONSE ERROR (ServiceCode=AuthorizationPermissionMismatch) =====
Description=This request is not authorized to perform this operation using this permission.
RequestId:b0027090-a01e-0088-18c7-6ff7a6000000
Time:2020-08-11T10:08:06.6069744Z, Details:
Code: AuthorizationPermissionMismatch
GET https://[REDACTED].blob.core.windows.net/[REDACTED]?comp=list&delimiter=%2F&include=metadata&restype=container&se=2020-08-14t10%3A03%3A25z&sig=-REDACTED-&sp=rwd&sr=c&sv=2018-11-09&timeout=901
User-Agent: [AzCopy/10.5.1 Azure-Storage/0.10 (go1.13; Windows_NT)]
X-Ms-Client-Request-Id: [efe44227-df00-47e1-74e4-f7a8670e0ace]
X-Ms-Version: [2019-02-02]
RESPONSE Status: 403 This request is not authorized to perform this operation using this permission.
Content-Length: [279]
Content-Type: [application/xml]
Date: [Tue, 11 Aug 2020 10:08:06 GMT]
Server: [Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0]
X-Ms-Client-Request-Id: [efe44227-df00-47e1-74e4-f7a8670e0ace]
X-Ms-Error-Code: [AuthorizationPermissionMismatch]
X-Ms-Request-Id: [b0027090-a01e-0088-18c7-6ff7a6000000]
X-Ms-Version: [2019-02-02]
`
Most helpful comment
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:
1.
This will output the SAS token. Then assuming your source file URL already has a SAS token from the Portal (or CLI) azcopy using:
2.