Azure Table Storage – How to Install and Setup

Introduction to Configuring for Azure Table Storage

We will be working on the Thumbnails example, which is installed with the Windows Azure SDK.

Thumbnails

The Thumbnails sample is a service that demonstrates a web role and a worker role.

What are web roles and worker roles?

A Windows Azure application can't actually see the VM it's running in.

A developer isn't allowed to supply his own VM image for Windows Azure to run, nor does he need to worry about maintaining this copy of the Windows operating system.

Instead, the CTP version lets a developer create .NET 3.5 applications using Web role instances and/or Worker role instances.

Web Role – What is it?

Each Web role instance accepts incoming HTTP (or HTTPS) requests via Internet Information Services (IIS) 7.

A Web role can be implemented using ASP.NET, WCF, or another .NET Framework technology that works with IIS.

As the above figure shows, Windows Azure provides built-in load balancing to spread requests across Web role instances that are part of the same application.

 

Worker Role – What is it?

A Worker role instance, by contrast, cannot accept requests directly from the outside world—it's not allowed to have any incoming network connections, and IIS isn't running in its VM.

Instead, it gets its input from a Web role instance, typically via a queue in Windows Azure storage.

The result of its work can be written to Windows Azure storage or sent to the outside world—outgoing network connections are allowed.

Unlike a Web role instance, which is created to handle an incoming HTTP request and shut down when that request has been processed, a Worker role instance can run indefinitely—it's a batch job.

Befitting this generality, a Worker role can be implemented using any .NET technology with a main() method (subject to the limits of Windows Azure trust, as described below)

Thumbnails Example – Web and Worker Roles

The web role provides a front end application for the user to upload photos and adds a work item to a queue.

The worker role fetches the work item from the queue and creates thumbnails in the designated directory.

The Front End

Building a front-end web site using ASP.NET web forms

Defining a web role

The Client uses REST

Calling REST API operations against Blob Storage and the Queue service

Built using Vista

Setting up your environment for Azure is critical to minimizing pain. Follow these steps carefully and you'll avoid unnecessary complications. I am assuming Vista. I realize this might not be everyone's preferred platform, but I have had nothing but great experiences developing on Vista. I haven't had to reboot in several days, even after uninstalling and reinstalling software.

The goal is to run some of the demo code that comes with Azure:

Necessary Software for Azure Table Storage

 

SQL Server 2008 Developer Edition

https://msdn.microsoft.com/en-us/bb851668.aspx

Visual Studio 2008 Professional

90 Day trial copy

Visual Studio 2008 Service Pack 1

Includes .NET framework 3.5 sp1

Windows Azure SDK

https://www.microsoft.com/downloads/details.aspx?FamilyId=BB893FB0-AD04-4FE8-BB04-0C5E4278D3E9&displaylang=en

Windows Azure for Microsoft Visual Studio October 2008 CTP

https://www.microsoft.com/downloads/details.aspx?FamilyId=63D0D248-1B08-4F7D-ABDE-62EB75CB1E69&displaylang=en

SQL Server Express Edition

https://www.microsoft.com/Express/

 

IIS 7 – Setup here is critical

From the Start menu, choose Control Panel | Programs | Programs and Features.

 

  • I installed all the selected features under:
    • Internet Information Services
    • Microsoft .NET Framework 3.0

Build the samples

There is a buildall.cmd file.

C:\Program Files\Windows Azure SDK\v1.0\samples\buildall.cmd

 

Run Windows Azure SDK Command Prompt as administrator. It is important that you run as "Administrator"

Windows Azure SDK Command Prompt

Run buildall.cmd

I got errors if I did not run as administrator.

Createtables.cmd

 

Creates a database with all the tables

 

Createtables.cmd

 

Creates a database with all the tables

 

   

Start SQL Server as Adminstroator

Note that SQLEXPRESS is used

 

Results of the CreateTables.cmd batch file

Note the various tables that were generated

Run the command "RunDevStore.cmd"

Development Storage

Thumbnails Example – A Highly Scalable Architecture

Not deploying out the cloud. Developing on the local developer fabric. The development fabric simulates the Windows Azure fabric on your local machine so that you may run and test your service locally before deploying it. The development fabric allows you to debug and fine-tune the behavior of your service before it is deployed.

This is a simple sample of 2-role service. These roles were previously explained in this blog.

Web Role

The web role displays a collection of thumbnails in a designated directory

It also provides a photo upload facility

Uploading a photo will results in a workitem for "thumbnail making" created in the queue

Message will be placed in queue for worker role to "pluck"

The image will also be stored as a blob

Worker Role

The worker role fetches such jobs off the queue and creates the thumbnails in the designated directory

Pullls thumbnail out of blog storage put there by the web role