Monday, June 20, 2016

Azure Command line tools - uploading blob to storage account

Most of your "cloud" workflows would require automating some operations that are part of your cloud service. I recently had to upload a blob to blob storage as part of a batch file. How to do that ? azure cli comes to the rescue.

Install Azure CLI as mentioned here : https://azure.microsoft.com/en-in/documentation/articles/storage-azure-cli/

That makes available the 'azure' command on your command line.



The help is quite exhaustive.

To upload a blob I used the following :

azure storage blob upload -f FILE_ON_DISK --container YOUR_CONTAINER_NAME --connection-string STORAGE_BLOB_CONNECTION_STRING

Use the --quiet option if you want to overwrite an existing blob on the cloud.

No comments:

Post a Comment