Bernie Cook's Blog

Azure, C#, .NET, Architecture & Related Tech News


Leave a comment

Distributed Design: Applying the Command Pattern to Azure’s Web/Worker Roles

WorkerRoleOne place I regularly come across the use of the Command pattern is when working on Azure projects that employ worker roles to execute long running tasks initiated by a scheduled process or user action. The Command pattern lends itself to the distributed nature of these solutions with very little plumbing required when working in Azure.

The following post provides a sample application; CommandQueue which contains 3 examples of a web and worker role utilising the Command pattern. The web role is designed to provide a rapid responses to the user, offloading any lengthy operations to the worker role. The source code for the CommandQueue solution is available on GitHub so feel free to clone, compile and execute it while working through this post.

Continue reading

Advertisements


4 Comments

Distributed Caching in Azure – Cache Worker Role

In June 2012 version 1.7 of the Windows Azure Platform release was introduced and with it came the new cache worker role. This provided another distributed cache management option for Azure developers alongside the likes of AppFabric Caching, or Memcached, to name a few. There are a number of ways to utilise and configure cache worker roles and this post covers one of them, providing a step by step guide to creating a new cloud solution where a web and worker role (cache clients) share the same cache worker role (cache cluster). Continue reading


3 Comments

Dynamically Creating Zipped PDFs in .NET

This post illustrates how you can dynamically create a number of PDFs on the fly, zip them all up, and return the ZIP file via a HTTP response.

I’ve created a sample project which you can download that has a working example of the source code referenced in the post – ZippingPDFs.zip (1.5 MB). For simplicity I went for an ASP.NET web application. The only requirements are that you have Visual Studio 2010 installed. Continue reading


1 Comment

Azure & Chart Controls: Step-By-Step Integration Guide

I recently integrated the ASP.NET 4 Chart Controls into a Windows Azure Web role. Integrating the charts was easy but getting it up and running in Azure required a few extra steps.

If you know much about the chart controls you know they create the chart image on the fly, and you can very easily configure the control to store the chart image to the server’s disk or to memory temporarily. With Azure the image may be generated by a different Web role instance than the one that has to serve it up so what you end up with, if you use the default setup, is a broken image placeholder instead of your fancy looking chart image. To accommodate this you have to create a custom handler for your Web role which stores, retrieves and deletes the chart image as a blob to your Azure storage container.

Below is a step-by-step guide on what you need to do to get the charts up and running in Azure. Continue reading