Avkash Chauhan's Blog

Windows Azure, Windows 8, Cloud Computing, Big Data and Hadoop: All together at one place.. One problem, One solution at One time...

A Command Line tool for downloading blob from Azure Storage and logging download completed back to Azure Storage

A Command Line tool for downloading blob from Azure Storage and logging download completed back to Azure Storage

Rate This
  • Comments 1

Time to time, I had to download blob from Windows Azure Storage for my Windows Azure Projects but so many time, when I was no in Azure VM, there was no way to be sure that my blob was downloaded successfully. To solve this problem I decided to simply write a command line tool which can download any file from Windows Azure storage and after download is completed, I also wanted to get confirmation that download is completed in  a log file at the Azure Storage. 

To make it very simple solution, I just created a command line application which use Windows Azure Storage Credentials to download blob from Azure Storage and after download is completed, the same application upload a log file to Azure blob storage to confirm that download is completed. 

To use this tool you can create a batch file as below:

 @REM Setting up Azure Stroage Credentials
set azurestoragename=happybuddha
set azurestoragekey=*******************************************************==
set storagecontainername=xyz

@REM Download blob name
set filename=apache-tomcat-7.0.19-windows-x64.zip
azurepackagedownloader.exe "%azurestoragename%" "%azurestoragekey%" "%storagecontainername%" "%filename%"


Once you will launch above batch file, the above apache-tomcat-7.0.19-windows-x64.zip will be download from the Azure Storage name "happybuddha" from container xyz. After the download completed, a log file will be uploaded to same "xyz" container in Azure Storage "happybuddha" as below:

If you look at the log file it look like as below:

8/9/2011 5:53:21 AM: Application Started......
8/9/2011 5:53:21 AM: Connection to Azure Storage : SUCCCESS.....
File Download Started....8/9/2011 5:53:38 AM: Transfer progress percentage = 1 - 0.00KB/s
8/9/2011 5:53:38 AM: Transfer progress percentage = 2 - 0.00KB/s
8/9/2011 5:53:38 AM: Transfer progress percentage = 3 - 914.36KB/s
8/9/2011 5:53:38 AM: Transfer progress percentage = 4 - 960.08KB/s
8/9/2011 5:53:38 AM: Transfer progress percentage = 5 - 948.23KB/s
8/9/2011 5:53:39 AM: Transfer progress percentage = 7 - 1,031.11KB/s
8/9/2011 5:53:39 AM: Transfer progress percentage = 9 - 1,174.62KB/s
8/9/2011 5:53:39 AM: Transfer progress percentage = 9 - 1,232.12KB/s
8/9/2011 5:53:39 AM: Transfer progress percentage = 10 - 1,280.11KB/s
8/9/2011 5:53:39 AM: Transfer progress percentage = 12 - 1,410.36KB/s
8/9/2011 5:53:39 AM: Transfer progress percentage = 12 - 1,488.50KB/s
8/9/2011 5:53:39 AM: Transfer progress percentage = 13 - 1,564.57KB/s
8/9/2011 5:53:39 AM: Transfer progress percentage = 16 - 1,726.84KB/s
8/9/2011 5:53:39 AM: Transfer progress percentage = 16 - 1,754.16KB/s
8/9/2011 5:53:39 AM: Transfer progress percentage = 17 - 1,796.56KB/s
8/9/2011 5:53:39 AM: Transfer progress percentage = 19 - 1,926.22KB/s
8/9/2011 5:53:39 AM: Transfer progress percentage = 20 - 1,989.61KB/s
8/9/2011 5:53:39 AM: Transfer progress percentage = 20 - 2,053.00KB/s
8/9/2011 5:53:39 AM: Transfer progress percentage = 21 - 2,057.31KB/s
8/9/2011 5:53:39 AM: Transfer progress percentage = 24 - 2,201.58KB/s
8/9/2011 5:53:39 AM: Transfer progress percentage = 24 - 2,259.51KB/s
8/9/2011 5:53:39 AM: Transfer progress percentage = 25 - 2,278.16KB/s
8/9/2011 5:53:39 AM: Transfer progress percentage = 26 - 2,308.39KB/s
8/9/2011 5:53:39 AM: Transfer progress percentage = 28 - 2,433.24KB/s
8/9/2011 5:53:39 AM: Transfer progress percentage = 29 - 2,447.71KB/s
8/9/2011 5:53:39 AM: Transfer progress percentage = 30 - 2,500.21KB/s
8/9/2011 5:53:39 AM: Transfer progress percentage = 31 - 2,567.50KB/s
8/9/2011 5:53:39 AM: Transfer progress percentage = 33 - 2,630.83KB/s
8/9/2011 5:53:39 AM: Transfer progress percentage = 34 - 2,641.39KB/s
8/9/2011 5:53:39 AM: Transfer progress percentage = 34 - 2,690.08KB/s
8/9/2011 5:53:39 AM: Transfer progress percentage = 37 - 2,765.14KB/s
8/9/2011 5:53:39 AM: Transfer progress percentage = 38 - 2,804.58KB/s
8/9/2011 5:53:39 AM: Transfer progress percentage = 39 - 2,849.98KB/s
8/9/2011 5:53:39 AM: Transfer progress percentage = 39 - 2,895.38KB/s
8/9/2011 5:53:39 AM: Transfer progress percentage = 40 - 2,852.40KB/s
8/9/2011 5:53:39 AM: Transfer progress percentage = 43 - 2,938.19KB/s
8/9/2011 5:53:39 AM: Transfer progress percentage = 44 - 3,032.57KB/s
8/9/2011 5:53:39 AM: Transfer progress percentage = 45 - 3,037.10KB/s
8/9/2011 5:53:39 AM: Transfer progress percentage = 46 - 3,041.03KB/s
8/9/2011 5:53:39 AM: Transfer progress percentage = 47 - 3,081.03KB/s
8/9/2011 5:53:39 AM: Transfer progress percentage = 48 - 3,132.84KB/s
8/9/2011 5:53:39 AM: Transfer progress percentage = 49 - 3,109.86KB/s
8/9/2011 5:53:39 AM: Transfer progress percentage = 50 - 3,159.82KB/s
8/9/2011 5:53:39 AM: Transfer progress percentage = 53 - 3,266.46KB/s
8/9/2011 5:53:39 AM: Transfer progress percentage = 54 - 3,219.99KB/s
8/9/2011 5:53:39 AM: Transfer progress percentage = 55 - 3,241.59KB/s
8/9/2011 5:53:39 AM: Transfer progress percentage = 56 - 3,229.94KB/s
8/9/2011 5:53:39 AM: Transfer progress percentage = 58 - 3,216.95KB/s
8/9/2011 5:53:39 AM: Transfer progress percentage = 59 - 3,282.26KB/s
8/9/2011 5:53:39 AM: Transfer progress percentage = 60 - 3,260.46KB/s
8/9/2011 5:53:40 AM: Transfer progress percentage = 62 - 2,925.24KB/s
8/9/2011 5:53:40 AM: Transfer progress percentage = 64 - 2,968.42KB/s
8/9/2011 5:53:40 AM: Transfer progress percentage = 65 - 2,899.79KB/s
8/9/2011 5:53:40 AM: Transfer progress percentage = 66 - 2,742.81KB/s
8/9/2011 5:53:40 AM: Transfer progress percentage = 67 - 2,530.66KB/s
8/9/2011 5:53:40 AM: Transfer progress percentage = 69 - 2,562.20KB/s
8/9/2011 5:53:40 AM: Transfer progress percentage = 70 - 2,503.56KB/s
8/9/2011 5:53:41 AM: Transfer progress percentage = 72 - 2,516.30KB/s
8/9/2011 5:53:41 AM: Transfer progress percentage = 73 - 2,531.08KB/s
8/9/2011 5:53:41 AM: Transfer progress percentage = 73 - 2,539.38KB/s
8/9/2011 5:53:41 AM: Transfer progress percentage = 74 - 2,365.97KB/s
8/9/2011 5:53:41 AM: Transfer progress percentage = 77 - 2,400.05KB/s
8/9/2011 5:53:41 AM: Transfer progress percentage = 78 - 2,369.11KB/s
8/9/2011 5:53:41 AM: Transfer progress percentage = 78 - 2,332.05KB/s
8/9/2011 5:53:41 AM: Transfer progress percentage = 79 - 2,210.81KB/s
8/9/2011 5:53:41 AM: Transfer progress percentage = 81 - 2,228.69KB/s
8/9/2011 5:53:41 AM: Transfer progress percentage = 82 - 2,238.31KB/s
8/9/2011 5:53:41 AM: Transfer progress percentage = 84 - 2,236.78KB/s
8/9/2011 5:53:41 AM: Transfer progress percentage = 85 - 2,235.29KB/s
8/9/2011 5:53:41 AM: Transfer progress percentage = 85 - 2,234.72KB/s
8/9/2011 5:53:41 AM: Transfer progress percentage = 86 - 2,240.97KB/s
8/9/2011 5:53:41 AM: Transfer progress percentage = 86 - 2,247.21KB/s
8/9/2011 5:53:42 AM: Transfer progress percentage = 87 - 2,135.87KB/s
8/9/2011 5:53:42 AM: Transfer progress percentage = 87 - 2,137.16KB/s
8/9/2011 5:53:42 AM: Transfer progress percentage = 90 - 2,160.34KB/s
8/9/2011 5:53:42 AM: Transfer progress percentage = 91 - 2,174.53KB/s
8/9/2011 5:53:42 AM: Transfer progress percentage = 91 - 2,180.25KB/s
8/9/2011 5:53:42 AM: Transfer progress percentage = 93 - 2,191.08KB/s
8/9/2011 5:53:42 AM: Transfer progress percentage = 93 - 2,196.09KB/s
8/9/2011 5:53:42 AM: Transfer progress percentage = 94 - 2,201.06KB/s
8/9/2011 5:53:42 AM: Transfer progress percentage = 96 - 2,132.67KB/s
8/9/2011 5:53:42 AM: Transfer progress percentage = 97 - 1,998.13KB/s
8/9/2011 5:53:42 AM: Transfer progress percentage = 97 - 2,025.19KB/s
8/9/2011 5:53:42 AM: Transfer progress percentage = 98 - 2,065.96KB/s
8/9/2011 5:53:43 AM: Transfer progress percentage = 98 - 1,973.64KB/s
8/9/2011 5:53:43 AM: Transfer progress percentage = 99 - 1,902.43KB/s
8/9/2011 5:53:43 AM: Transfer progress percentage = 100 - 1,812.30KB/s
8/9/2011 5:53:43 AM: Transfer completed. Press any key to continue.
8/9/2011 5:53:43 AM: File apache-tomcat-7.0.19-windows-x64.zip Download Completely!!!

I got some kick start for this tool from Kevin blogs as below:

http://blogs.msdn.com/b/kwill/archive/2011/05/30/asynchronous-parallel-block-blob-transfers-with-progress-change-notification.aspx

Using above blog I took the base BlobTransfer class written by Kevin and just added some code to create a commnadline application which can satisfy my need. You can download from the same tool from codeplex  as below: 

http://azureblobdownloader.codeplex.com/

Leave a Comment
  • Please add 7 and 6 and type the answer here:
  • Post
  • You can also the Blob Transfer Utility to download and upload all your blob files.

    It's a tool to handle thousands of blob transfers in a effective way.

    Binaries and source code, here: http://bit.ly/blobtransfer

Page 1 of 1 (1 items)