How can i use azcopy in command to copy a file from Azure storage to AWS s3 bucket?

198 Views Asked by At

I have a file in azure storage that i want to copy to AWS S3 using azcopy. I have tried the following. The file is called test.txt, Azure storage account is called testsa, Azure container is testsacontainer.
S3 bucket name is S3TestBucket

I have aws access key and secret.

   azcopy copy "https://<source-storage-account>.blob.core.windows.net/<container-name>/<file-path>;" "s3://<bucket-name>/<destination-file-path>" --source-credential-type "AzureBlob" --destination-credential-type "AWS" --destination-aws-access-key "<AWS-access-key>" --destination-aws-secret-key "<AWS-secret-key>"

I used the following :

azcopy copy 
"https://testsa.blob.core.windows.net/testsacontainer/test.txt;" 
"s3://S3TestBucket/test.txt" --source-credential-type "AzureBlob" 
 --destination-credential-type "AWS" --destination-aws-access-key 
 "<AWS-access-key>" --destination-aws-secret-key "<AWS-secret- 
 key>"

It gives the error: unknown flag: --source-credential-type

Is just the name of the file.

How can i do this ?

1

There are 1 best solutions below

4
Venkatesan On

How can I use AzCopy in a command to copy a file from Azure storage to an AWS S3 bucket?

As of now, This Documentation states you can only able to copy a file from AWS(s3) to Azure.

Command:

azcopy cp "https://s3.amazonaws.com/[bucket]/[object]" "https://[account-name].blob.core.windows.net/[container-name]/[your-blob-name]?[SAS]" --recursive=true

SAS is your Azure Blob Storage shared access signature, which you can get from the portal.

Portal: enter image description here

Reference:

Move your data from AWS S3 to Azure Storage using AzCopy | Microsoft Azure Blog

Update:

I agree with Gaurav Mantri's comment, It is not possible with Azcopy for copying from Azure blob storage to S3. Only possible with S3 to Azure blob storage.