[This is prerelease documentation and is subject to change in future releases.]
The Windows® Azure™ SDK provides a number of code samples to help you get started building applications for the fabric.
This topic contains the following subtopics:
Building and Running the Sample Applications
Sample Applications
Building and Running the Sample Applications
The sample applications are included in the SDK installation in the samples.zip file. By default, this file is installed to C:\Program Files\Microsoft Windows Azure SDK\v1.0\. To work with the sample applications, first unzip them to a directory on your local computer for which you have write access.
Note |
|---|
|
You may not have write access to directories under the Program Files directory by default, so it's recommended that you choose a different parent directory for the sample applications, such as C:\Samples. |
The Windows Azure SDK samples are designed to be built and run without Microsoft® Visual Studio®. You can also build and run the samples from Visual Studio if you have installed the Windows Azure Tools for Visual Studio.
Note |
|---|
|
Loading and running the sample applications from Visual Studio without the Windows Azure Tools is not supported. If you are using Visual Studio, please download and install the tools. |
Sample Requirements
To run the samples, you must have installed the following:
-
Microsoft .NET Framework 3.5 SP1
-
Microsoft SQL Express 2005 or later
-
Internet Information Services (IIS) 7.0, ASP.NET and Windows Communication Foundation (WCF) HTTP activation must be enabled
-
Windows PowerShell™ command-line interface is required for the CloudDrive sample
-
The Microsoft C/C++ compiler, cl.exe, is required to compile the native code executable that is included with the FastCGI sample. The compiler is available in Visual Studio, in the Windows SDK, or in Visual C++ 2008 Express Edition.
See Getting Started with the Windows Azure SDK for more information.
Sample Readme Files
For detailed information about running the Windows Azure SDK samples, be sure to review the readme file for each sample.
Preparing the Samples and the Development Environment
Three commands reside at the root of samples.zip:
-
The buildall.cmd utility builds all of the samples.
-
The createtables.cmd utility calls buildall.cmd and creates the database and tables required for the samples that employ the local Table service.
-
The rundevstore.cmd utility calls createtables.cmd and launches development storage, pointing it to the database created by createtables.cmd. Running development storage starts the local Blob, Queue, and Table services.
In most cases, you can simply run rundevstore.cmd to prepare the samples to be run.
The first time you launch development storage, an initialization process runs to configure the local environment. You can also run this process explicitly by calling DSInit.exe. Note that running this process requires administrative privileges.
Note |
|---|
|
The command script setvcvars.cmd locates the Microsoft C/C++ compiler, cl.exe, for use with this sample. It is not necessary to call setvcvars.cmd directly, as it is called by the build scripts for the samples. |
Running the Sample Applications Without Visual Studio
After you have built the sample applications, created the database tables, and launched developer storage, you can run an individual sample. From the command line, navigate to the directory containing the sample that you wish to run, and call the runme.cmd script to run the sample.
Calling the runme.cmd script will start the development fabric if it is not already running; when the development fabric starts, you'll see the development fabric icon appear in the system tray. Right-click this icon to display the development fabric UI.
Running the Sample Applications with the Windows Azure Tools for Visual Studio
If you have installed the Windows Azure Tools for Visual Studio, you can build and run the sample applications from within Visual Studio.
Sample Applications
The Windows Azure SDK includes the samples listed in the following table. Each sample includes a readme file that provides more information on how the sample works and how to use it.
|
Sample
|
Description
|
|---|
AspProviders Sample | Provides a sample library with implementations of these ASP.NET providers: Membership, Role, Profile, Session State. |
AspProvidersDemo Sample | A simple service that makes use of the ASP.NET provider sample library. |
CloudDrive Sample | A Windows PowerShell provider that enables command-line access to Blob and Queue service resources as though they are file system resources available via a network drive. |
DistributedSort Sample | A distributed sorting service that demonstrates the use of the Blob and Queue services. |
FastCGI Sample | A simple service that demonstrates running a native code FastCGI application. |
FullTrust Sample | A simple service that shows how to create a web role and a worker role that run with full trust privileges. |
HelloFabric Sample | A simple service that demonstrates a web role and a worker role and uses the Windows Azure runtime API to interact with the fabric from a running instance. |
HelloWorld Sample | Demonstrates how to package a service for deployment to the fabric. |
PersonalWebSite Sample | Demonstrates how to port an ASP.NET Web application to the Windows Azure environment. |
StorageClient Sample | A sample client library that provides .NET wrapper classes for REST API operations for the Blob, Queue, and Table services. The sample also includes a console application that can be used to test the library functionality. |
Thumbnails Sample | A service that demonstrates a web role and a worker role. 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. |
See Also