Tuesday, July 4, 2017

Uploading/Downloading files to blob storage in Azure from Ubuntu

Install Azure CLI click here for Installation steps

#Uploading file to blob storage in Azure from Ubuntu/Debian

az login
export AZURE_STORAGE_ACCOUNT=your-classic-storage-account--no_need_of_any_quotes
export AZURE_STORAGE_ACCESS_KEY=your-access-key--available-with-storage-account-onportal--no_need_of_any_quotes
export container_name=any-container-name
export blob_name=any_filename_that_you_wish_to_keep_for_uploaded_file

echo "uploading the file"
az storage blob upload -f file_complete_path -c $container_name -n $blog_name

echo "downloading the file"
az storage blob download -c $container_name -n $blob_name -f file_location_tosave

#Listing the files under that storage account
az storage blob list -c $container_name

No comments:

Post a Comment