Skip to content

Instantly share code, notes, and snippets.

@maxgfr
Last active March 13, 2024 10:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxgfr/5ee07794b579bf01b676e670da69e0fd to your computer and use it in GitHub Desktop.
Save maxgfr/5ee07794b579bf01b676e670da69e0fd to your computer and use it in GitHub Desktop.
From azure storage to s3

Migrate files from azure storage to s3 using cli

Dowload files from azure

mkdir toto && cd toto
az storage blob download-batch --account-name account_name --account-key account_key --source bucket_name --destination . --pattern "*" 

Upload to S3

1. Configure the credentials

aws configure

2. Upload all files from folder

aws s3 cp toto s3://bucket_name/folder --recursive --endpoint-url=https://url.net

Note: --acl public-read for setting public read for all files

Bonus

List files from folder

aws s3 ls s3://bucket_name/folder --endpoint-url=https://url.net --recursive 

Delete folder

aws s3 rm s3://bucket_name/folder --endpoint-url=https://url.net --recursive

Upload file

aws s3api put-object --acl public-read --key test_file.png --body toto/test_file.png --endpoint-url https://url.net --bucket bucket_name

Get file

aws s3api get-object --bucket bucket_name --key test_file.png --endpoint-url https://url.net result.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment