Before you install and use Windows Azure Thumbnails Sample you must:

  1. Review the Windows Azure Thumbnails Sample license terms by clicking the Custom link above.
  2. Print and retain a copy of the license terms for your records.

By downloading and using the Windows Azure Thumbnails Sample, you agree to such license terms.  If you do not accept them, do not use the software.


The Windows Azure Thumbnails sample is a hosted service that demonstrates a web role, a worker role, and a queue. The web role provides a front-end application for the user to upload images and adds a work item to a queue. The worker role retrieves the work item from the queue and creates thumbnails in the specified folder.


Building and Running the Sample

To run the sample from Visual Studio 2010

  1. Open Visual Studio 2010 as an administrator.
  2. Browse to the folder where you extracted the sample and open Thumbnails.sln.
  3. Press F6 to build the solution.
  4. Press F5 to debug the solution. When you debug or run the application from Visual Studio, Visual Studio packages the application, starts the Windows Azure Compute Emulator, deploys the application to the Compute Emulator, and launches the browser to display the default web page defined by the web role.
  5. The page displayed by the web role instance shows images that have been previously uploaded. Click Browse to select an image to upload. Click Submit to upload the file, create a blob in the appropriate container, and add a message to the queue for the worker role instance.

Configuring the diagnostic connection string

The Windows Azure Managed Library provides diagnostics classes to write log data to the Windows Azure storage services, either at scheduled intervals or by requesting an on-demand transfer. By default, the Windows Azure Thumbnails sample is configured to write log data and image data to development storage. If you choose to deploy the application to Windows Azure, you must change the configuration string in the service model to specify a storage account in
Windows Azure.

To change the diagnostic connection string in Visual Studio

  1. In Solution Explorer, expand Roles, right-click Thumbnails_WebRole , and then click Properties.
  2. On the Settings page, select Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString, and then click the Edit (...) button.
  3. Select Enter Storage Credentials, and then enter your account name and key for your Windows Azure storage account.
  4. Select whether to use the default HTTP or HTTPS endpoints to connect to the storage services. Alternately, you can configure custom endpoints for each of the three storage services.
  5. Click OK.
  6. Repeat this process for the worker role.

To change the diagnostic connection string by using a text editor

  1. Edit the ServiceConfiguration.cscfg file using a text editor, such as Notepad.
  2. Change the value of the Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString setting to use a connection string for Windows Azure storage. The connection string must be in the format shown in the example below.
  3. Locate the Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString setting for the worker role and change it in the same way.
  4. Save the ServiceConfiguration.cscfg file.
You must choose either http or https, <account-name> must be changed to the name of your storage account, and <account-key> must be changed to the key of your storage account.