Skip to content

Instantly share code, notes, and snippets.

@namiwang
Created May 30, 2016 08:27
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 namiwang/ef4d2d1f6fc20b4888be3a8bf9d30d9f to your computer and use it in GitHub Desktop.
Save namiwang/ef4d2d1f6fc20b4888be3a8bf9d30d9f to your computer and use it in GitHub Desktop.
azure blob folder uploader
#!/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