Monday, July 18, 2011

Windows Azure Web Role Accelerator

Deploying new WebSites to Windows Azure or updating existing ones used to take a lot of time. And the Windows Azure Team worked hard on this issue making it more comfortable for developers.

And the result of this effort is the “Windows Azure Accelerator for Web Roles” announced a few days ago. That is a new Project Template generating an Azure Project containing a WebRole and a website project for management purposes. Here you can define how many instances of your website are to be created in the cloud. After deploying this project template Windows Azure will create the instances you requested. Then you can create websites in the management website and publish other websites in less than 30 seconds to the cloud. Those websites will immediately be available on all instances. The template uses your Windows Azure Storage account for this feature.

Here is a short demo video of the Web Role Accelerator:

Download the Web Role Accelerator from codeplex here: http://waawebroles.codeplex.com/

Backlink to the Windows Azure Team Blog: NOW AVAILABLE: Windows Azure Accelerator for Web Roles

Sunday, July 3, 2011

tangible.AzureIO - small sample

Because I’m short on time at the moment, I’ll just post a tiny little sample on the AzureIO library. I promise to publish a larger sample soon. Maybe I can think of something really useful, we’ll see…

For the moment it’s just a simple WPF application that allows the user to select a file (#1 in the picture) and upload it to the Windows Azure BlobStorage (#2). As a proof that the file was really uploaded, the application displays the url of the blob where the file can be viewed in the browser.

sample

There’s not a lot of code behind this sample. At first it’s to mention that the AzureIO library requires a configuration setting in the app.config file. The connection string to the StorageAccount needs to be set there.

  1: <configuration>
  2:   <appSettings>
  3:     <add key="StorageCredentials" value="UseDevelopmentStorage=true"/>
  4:   </appSettings>
  5: </configuration>

This configuration makes the application use the development storage of the Windows Azure SDK. To upload the file to the blob storage those three lines of code suffice:

  1: var fileName = System.IO.Path.GetFileName(txtFile.Text);
  2: var content = System.IO.File.ReadAllBytes(txtFile.Text);
  3: tangible.AzureIO.File.WriteAllBytes(fileName, content);

VoilĂ  – that’s it. Copy the displayed URL to your browser and get your file from the cloud!


Download the sample code here: AzureIOSample.zip

Friday, July 1, 2011

tangible.AzureIO - Accessing BlobStorage like System.IO

Writing and reading blobs to and from the Windows Azure BlobStorage isn’t as comfy as one could wish. So why not dealing with Files transferred to the cloud as if they were files we are used to work with?

Nothing looks smoother than this simple call to create a new file and write some bytes in it:

  1: System.IO.File.WriteAllBytes("MyFile.ext", new byte[] { ... });


Doing the same in the cloud requires connections to the CloudStorage, creating a BlobClient, dealing with containers and different BlobTypes … A huge overhead to what one really needs in this case. But how about this call doing exactly the same as shown above in the local file system – only in the cloud:

  1: tangible.AzureIO.File.WriteAllBytes("File.ext", new byte[] { ... });

Easy, isn’t it?


The tangible.AzureIO library contains nearly all functionality offered by System.IO for the cloud. A must have for developers who want to move their applications to the cloud with least changes! Find pendants to System.IO.Path in tangible.AzureIO.Path, System.IO.Directory in tangible.AzureIO.Directory and so on…


I spent a lot of time on this project and finally may publish a first beta version here. The library for download below is delivered “as is” – without any warranty and claims neither completeness nor faultlessness. All right reserved. You may use it in any of your projects – but it’s still a beta and subject to change.


I appreciate any comments and reviews on this library! So feel free to leave a comment to this blog post or send me an email to nico[at]zehage.net.


Download tangible.AzureIO here: tangible.AzureIO.zip