Created
May 30, 2016 08:27
-
-
Save namiwang/ef4d2d1f6fc20b4888be3a8bf9d30d9f to your computer and use it in GitHub Desktop.
azure blob folder uploader
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# https://stackoverflow.com/questions/28900078/upload-multi-file-from-linux-folder-to-azure-blob-storage | |
export AZURE_STORAGE_ACCOUNT='your_account' | |
export AZURE_STORAGE_ACCESS_KEY='your_access_key' | |
export container_name='name_of_the_container_to_create' | |
export source_folder=~/path_to_local_file_to_upload/* | |
echo "Creating the container..." | |
azure storage container create $container_name | |
for f in $source_folder | |
do | |
echo "Uploading $f file..." | |
azure storage blob upload $f $container_name $(basename $f) | |
cat $f | |
done | |
echo "Listing the blobs..." | |
azure storage blob list $container_name | |
echo "Done" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment