Thursday, November 20, 2008

Azure Storage Services Test Harness: Table Services 3 –Starting the Test Harness Project

Update 1/31/2009: Code is now available for download.

This is the third of a series of articles about a ASP.NET 3.5 C# test harness for Azure Storage Services that is will be available for download from my “Retire Your Data Center” cover story for Visual Studio Magazine’s February 2009 issue (click the Get Code Download link) in the near future.

Here are links to the earlier episodes in this series:

Installing Windows Azure Tools for Visual Studio 1.0 adds Cloud Service and CloudWorkflow project types and installs four Cloud Service templates. To create an ASP.NET Web Application that uses Azure Table Services as a data source, select a Cloud Service project and the Web Cloud Service template:

Note: For a more detailed description of the setup process for a simple project, take Jim Nakashima’s Windows Azure Walkthrough: Simple Table Storage of 10/28/2008. If you haven’t done so already, take Jim’s Video Walkthrough: A Quick Lap around Windows Azure Tools for Microsoft Visual Studio of 10/28/2008 before starting the Table Storage project. This post covers steps 1 through 6 of Jim’s walkthrough.

The Web Cloud Service template adds the Cloud Service project (*.ccproj) with a Roles folder, which contains a pointer to an added Web Cloud Service ProjectName_WebRole project that contains the ASP.NET client components. The *.ccproj file contains ServiceConfiguration.cscfg and ServiceDefinition.csdef files. By default, the ServiceConfiguration is set to Development Fabric and Development Storage.

References to the Microsoft.ServiceHosting.ServiceRuntime and System.Data.Services.Client (ADO.NET Data Services [Astoria] Client) namespaces are added automatically to the ProjectName_WebRole project.

You must also add references to the ProjectName_WebRole’s Common.dll and StorageClient.dll helper assemblies; these two assemblies and their sample code are contained in the \Program Files\Windows Azure SDK\1.0\ file. Their source code and DLLs have been copied into the test harness project’s source code to support portability. (Class diagrams are optional.)

Common.dll and StorageClient.dll are sample, not official, libraries for Azure application developers. Here’s Aleks Gershaft’s (Microsoft) response to Wayne Walter Berry’s Understanding the Role of StorageClient in Our Application thread of 11/20/2009 in the Windows Azure forum:

The current version of StorageClient is provided as a sample for the developers and should not be considered an official library. The documentation has the following disclaimer:

The StorageClient sample library is not optimized for performance and is not intended to be used for building robust services, but only as an example of a working client library.

We are not ready to announce any future plans with respect to any official library.
Note: We consider the REST APIs to be the official APIs for Windows Azure storage and therefore any changes in those will be done with minimal impact on existing code.

The next episode in this series is: Azure Storage Services Test Harness: Table Services 4 – Programming the Table Services API.