Sunday, July 05, 2009

Windows Azure Blob Test Harness Project is Live!

My Azure Blob Test Harness currently is live at http://oakleaf2.cloudapp.net/default.aspx. This project complements the Azure Table Test Harness that’s been at http://oakleaf.cloudapp.net/default.aspx since 12/9/2008. The new test harness lets you create blobs from bitmaps and *.zip files stored in my Windows Live SkyDrive account. The files range in size from 73 kB to 36.9 MB. Alternatively, you can generate blobs from files stored in your PC’s file system. See the later “Source Code” section for download details.

Update 7/4 and 7/5/2009: Five of the seven blob files became inaccessible overnight due to URL changes. The AzureBlob2048.bmp file’s URL didn’t change (yet). A new folder with the same set of files is being tested now for stability. The IDs for the new files have 10 more characters than the last version in their URLs. The same five files became inaccessible overnight; the IDs for the new files have 10 fewer characters than their predecessors.

The Blob source datastore has been moved from SkyDrive to DropBox (see my Direct Access to Windows Live SkyDrive Files Has Weird Inconsistencies post of 7/5/2009.)

Update 7/3/2009: Six of the seven blob files became inaccessible again because because Windows Live SkyDrive changed the ID this time by altering GUID characters. For example: <asp:ListItem Value=http://fjhpug.bay.livefilestore.com/y1pV6_PqKqBZvm_ohhfxNT7ffl0n8S0udQvP_f4Lj4PXFpJXEMnduOEUNy3z5ZthO7U1a-P7ItHCjne4x3F05GtDA/AzureBlob2048.bmp>
AzureBlob2048.bmp, Bitmap from SkyDrive, 2048 px, BMP, 9.2 MB</asp:ListItem>

Became: <asp:ListItem Value="http://fjhpug.bay.livefilestore.com/y1pPi2jUgioJlt7KDVLTtraZRf3dhByvzhulr22a_Enyl9OIB30ft8cfjU8PHS5W8QywMiGIjivbvEk9wypmDyCyA/AzureBlob2048.bmp">
AzureBlob2048.bmp, Bitmap from SkyDrive, 2048 px, BMP, 9.2 MB</asp:ListItem>

I also added a “Help” hyperlink control with this post as it’s NavigateURL target.

Update 5/6/2009: Six of the seven blob files became inaccessible to the project this week because Windows Live SkyDrive changed the ID by adding characters. (Not nice.) I fixed and updated the project today for inclusion as the sample project in my “Targeting Azure Storage” “Master Azure’s Cloud Storage for Blobs” feature article for the June or July issue of Visual Studio Magazine. The article will include a link to download the source code.

My “Retire Your Data Center” Article about Azure’s Table Storage is VSM’s February 2009 Cover Story. For more details about that sample project and how to use Azure Table Data Services, see my Windows Azure Test Harness Is Live! post of 12/9/2008 and Azure Storage Services Test Harness: Table Services 1 – Introduction and Overview of 11/18/2009.

Source Code: The Get Code Download Link includes listings that are missing from the article’s online version and print edition but currently doesn’t include the article’s source code. I’ve temporarily made the source code, AzureBlobTestHarness.zip, available from my SkyDrive account until the article’s link is updated. Click here to download the current source code.

Credits: The local file upload feature is based on Jim Nakashima's DownloadSite code that’s described in his Windows Azure Walkthrough: Simple Blob Storage Sample post of 10/29/2008. GZip and Deflate code is based on Rick Strahl's HttpWebRequest and GZip Http Responses post of 6/29/2007.

Uploading from a File Stored on Windows Live SkyDrive

The default operating mode is to upload one of three AzureBlob####.bmp or four AzureBlob ####.zip files from Windows Live SkyDrive. (#### is the horizontal size of the image in pixels.)

Accept the default 1024 (x 768) pixel bitmap and click the Create Blob button (once) to add the blob to the list in ISO-8601 UTC DateTime order.

Select the SkyDrive file from which to create the blob in the dropdown list, which adds the file alias to the Link Name text box, and then click the Create Blob button (once) to create the blob. Please be patient when creating very large blobs. The process can take more than two minutes for a 37-MB blob.

Note: The 8192-px bitmap exceeds SkyDrive’s 50-MB maximum file size limit, so it isn’t included in the preceding list.

Click the appropriate cell of the Link column to open bitmaps in a new browser window (see below) or .zip files in a File Download dialog.

Deletion is prevented when the GridView contains three rows or fewer.

Blob additions and deletions generate log entries as described in my Fighting the Azure Blob Storage Blues post of 1/2/2009. Exceptions generate entries with the x-ms-request-id response header value to aid the Azure team when troubleshooting issues.

Uploading from the Client’s File System to a Blob

Alternatively, you can upload files of most MIME types from your local machine to Azure blobs. Clear the SkyDrive check box and click the FileUploadControl’s Browse button to open the Choose File to Upload dialog. Select a file and click Open to add its well-formed path to the File Path\Name text box.

Type a file alias in the Link Name text box and click Create Blob.

Here’s a screen capture of an entry for a blob containing a small .png file.

Please post questions or suggestions for improvements as comments.

If you’re interested in the sample StorageClient class library’s support for creating, modifying, and deleting blobs with .NET code instead of RESTful HTTP Request and Response messages, check out my Azure Storage Services - StorageClient Library: Blob Storage API Class Reference post of 1/6/2009.

Final source code will be available from a future the June 2009 issue of Visual Studio Magazine.

4 comments:

Anonymous said...

What is the difference between Upload Time and Create Time in your demo app?

Roger Jennings (--rj) said...

@Anonymous,

Upload time is the time in seconds to cache the original image (in BMP format for this example) from the online source to Azure memory.

Create time is the time in seconds required to create the thumbnail from the cached image.

Rosi said...

I created sample similar to this. I tested for fileuploads above 100MB. it's failing with error as "there is not enough space on the disk". Even http://oakleaf2.cloudapp.net/Default.aspx is also not working for above 100Mb.

Roger Jennings (--rj) said...

@Rosi,

The 100-MB limit might be a CTP issue. SkyDrive had a 50-MB cap, so I didn't try larger blobs.

My blob test harness automatically chunks uploads into 1-MB blocks, so the 64-MB size limit for a single upload doesn't appear to be an issue here.

--rj