Accessing Blob Storage
In this part we want to extend the application and move some of our data into the cloud as well. Let’s start simple and move some blobs into the Windows Azure Blob storage. In this example I use a Microsoft Research (MSR) HD View application that I created with MSR ICE and render it as an iFrame inside the InfoBox of a VEShape-object.
We will also make the files publicly available to keep it simple. An example for authentication and authorisation will be in the 3rd part in which we look at the table storage.
First open up your Windows Azure Developer Portal and create a new Storage Project:
Note the storage endpoints and your keys. Obviously you can write an application and uploads, downloads or deletes files from the Windows Azure Blob storage but there are also tools available that you can use. In the Windows Azure SDK for example you will find a number of sample applications. One of which is the CloudDrive that allows you to work with the cloud storage through the Windows PowerShell and provides lot’s of command-line functions including a feature similar to xcopy:
Those who prefer the comfort of a graphical user interface will like SpaceBlock which you can download via CodePlex:
So lets create our folders. By right-clicking on the level 1 folder (e.g. hdview) you can open up a context menu that allows you to set the access rights for the container. As mentioned before I’ll give them for now public access. Note: this right is only for reading, not for write-access.
Now that I have my container in the Windows Azure Blob Storage I transfer my local files to the cloud and do the same again for videos, photos and my VETileLayer. SpaceBlock makes it really as simple as working with your local file-system
Once the files are uploaded you can select them in SpaceBlock, right-click on them and have SpaceBlock generate a URL. Lastly you only need to change the URL’s in your application and you’re done. Below is an example for the data file that is used in Sllide.Show 2.
<?xml version="1.0" encoding="utf-8"?> <data startalbumindex="0" transition="CrossFadeTransition"> <album title="Wilfreigehege Hellenthal" description="June 2008" image="http://hannesvestorage.blob.core.windows.net/photos/Wildfreigehege_Hellenthal/CIMG2143_t.jpg"> <slide title="Wildfreigehege Hellenthal" description="June 2008 - Taken: 10/06/2008" image="http://hannesvestorage.blob.core.windows.net/photos/Wildfreigehege_Hellenthal/CIMG2139_s.jpg" thumbnail="http://hannesvestorage.blob.core.windows.net/photos/Wildfreigehege_Hellenthal/CIMG2139_t.jpg" datetaken="10/06/2008" /> ...