Deploy This Silverlight Application on Windows Azure in 10 minutes – no Tools Required!

This post guides you through the process of deploying and configuring the provided Silverlight application on Windows Azure through the Windows Azure Platform web portal using just your compatible web browser.  You do not need any development tools…

The included Guest Wall application is a Silverlight app hosted in a ASP.NET website that runs on Windows Azure Hosted Services and uses the Windows Azure Cloud Storage to store messages that anyone can post.  You can configure it to some extent as explained below.

image

During December 2009* you will need the following 3 things to complete this deployment:

  1. The application package and configuration files provided** – download link in the guide below.
  2. A Windows Live ID to create a Windows Azure Platform account (or the Live ID you associated with an existing platform account).  You can create a free Windows Live ID if necessary (using an existing email address or a new free Windows Live e-mail address that you can create at the same time).
  3. A token for a free preview* of Windows Azure services.  These tokens are typically provided by Microsoft employees you know, at conferences, or via other people you know/follow that have spare unused ones.  In Canada you can currently email cdnazure@microsoft.com to request one.

Deployment Guide

Step 1 – Get the application files

  • Download the zip file and extract the 3 files to a suitable location you can remember (e.g. your desktop).  The included source.zip file contains the source so you can (if you wish) download the full toolset to recompile or modify the code**. 

Step 2 – Create a Windows Azure Platform account (if you don’t have one)

image

  • Sign in using your Windows Live ID which leads you to the account creation process…

image

  • Click “I Agree” to proceed if you agree to the Privacy Statement indicated…

image

  • Click “Continue” to proceed…

image

  • Enter the unused token you have been provided for Windows Azure services and click “Next”.  A valid token is in the format XXXXX-XXXXX-XXXXX-XXXXX-XXXXX where X is a letter or number.

image

  • Click “Accept” to proceed if you agree to the Windows Azure terms of use indicated…

image

  • “Continue” on to the main portal home page.

image

  • Click on the Project Name (typically “PDC08 CTP”)…

image 

Step 3 – Create a Windows Azure Storage Account

  • Click on “New Service”…

image

  • Select Storage Account…

image

  • Enter the text in the two boxes exactly as you see it above and click “Next”…

image

  • Enter a storage host name.  You need this later and it must be unique within the azure domain shown.  You can check the availability using the button.  Also, under affinity group, select “Yes”, and the “Create…” option; enter “GuestWall” for the affinity group name and select “South Central US”; finally click on “Create” and wait…

image

  • You should see your Storage Host Name repeated 3 times.  Copy the Primary Access Key for later.  You have now created your Cloud Storage.

Step 4 – Create a Windows Azure Hosted Service

  • Click on “New Service”…

image

  • Now, this time, select “Hosted Services”

image

  • Enter the text in the two boxes exactly as you see it above and click “Next”…

image

  • Enter a service host name to create your Service Address.  It must be unique within the Azure domain shown.  This will be the public web address that is used to access your application.  You can check the availability using the button.  Also, under affinity group, select “Yes”, and the “Use existing…” option; select the “GuestWall” group you created before; finally click on “Create” and wait…

image

  • Now you are ready to deploy/upload the application.  If you click on the vertical line and arrow on the right you will see an optional Staging deployment area.  We are NOT using that in this sample deployment.

Step 5 – Deploy the application and configure it

Click on the Deploy button…

image

  • Use the two “Browse” button to select the files you downloaded and extracted.  The open file dialog will filter the view so that you only see 1 correct file type at a time for each button.  Enter “1.0” in the bottom box as shown.  Click the “Deploy” button and wait a while…  and a while longer…  perhaps 2 to 5 minutes.

image

  • Your application has been deployed in a “Stopped” state and needs to be configured first.  Click on “Configure”…

image 

  • And now for the trickiest part.  Replace the highlighted XML shown above with the following XML.  Then modify it by putting in your unique Storage Host Name (just the initial hostname, not the full web address) and your Primary Access Key (from earlier) in the places indicated.

<Setting name="DiagnosticsConnectionString" value="DefaultEndpointsProtocol=https;AccountName=YourStorageHostName;AccountKey=PrimaryAccessKey" />
<Setting name="DataConnectionString" value="DefaultEndpointsProtocol=https;AccountName=YourStorageHostName;AccountKey=PrimaryAccessKey" />     

<Setting name="Title" value="My Guest Wall" />
<Setting name="WallBackColor" value="#99cc66" />
<Setting name="FontFamily" value="Georgia" />
<Setting name="MessageColor" value="#6699cc" />
<Setting name="MessageBackColor" value="#f3f6ec" />
<Setting name="ClearText" value="clear" />

  • You can also modify the value of the other settings to customise the application.  The ClearText setting is the text you enter as a special message to clear the wall of all messages – so you may want to change that to something that only you know.
  • Be careful not to break the XML formatting.
  • When you have finished, go ahead and click “Save”… and prepare to wait a few more minutes…

Updated:  The " character after the second PrimaryAccessKey was incorrectly a left-angle double-quote character (“) – very subtle difference – now fixed; blame Windows Live Writer ;).  If you were copying it to the portal you may have been getting a syntax error; your deployment could still be Run (below) without the updated configuration and be accessible, but it would not have been able to connected to the ‘wall message store’ to retrieve/store messages.

image

  • Once you get back to this state… click on “Run” and wait until the small traffic light icon shows your application is “Ready”….

image

  • Click on the Service Address link to try out your application.  It may be a little slow the first time.  Click on the large area to enter a message.  Enter the text in the ClearText setting as a message, to remove all the messages.  Check that the messages stay on the ‘wall’ when you refresh the browser.  If the application shows an error indicating that it can’t retrieve messages then check the configuration file.  Try changing the configuration to customise the look and feel of the application.

Step 6 – Leave me a comment 🙂 (and perhaps include your Service Address URL)

CONGRATULATIONS! – you have deployed your first Windows Azure Platform application.

Modifying your application

  • To open the solution provided in the download, you will need Visual Studio 2008 SP 1 (or Microsoft Visual Web Developer 2008 Express with SP1) and .NET Framework 3.5 SP1.  Before you open the VS solution you should also install the Silverlight 3 Tools for VS 2008 SP1 and the Windows Azure Tools for VS (and following the Instructions on that page).  If you have SQL Developer, instead of SQL Express installed, you may need to do some configuration with the Azure Tools DSINIT command for the local Azure storage emulation to work.  You need to run VS as an administrator to run the Azure test environment on your machine. 

Good luck – and come back for other posts on Azure and Silverlight!

*On January 4 2010, the Windows Azure Platform products switch from token-based free community preview to live production but will remain in a free preview mode for one month with chargeable metered use beginning on February 1 2010.  You will have to setup up a payment method in order to continue and be charged from that point.  The platform includes Windows Azure (Hosted Services and Storage Accounts), SQL Azure and AppFabric (Service Bus and Access Control) which each have their own consumption-based pricingMicrosoft will include a quantity of Windows Azure Platform consumptions units as part of MSDN Subscriptions in certain countries.

**Content provided subject to this blog’s conditions of use for content.  Additionally, I hereby grant you a royalty-free worldwide perpetual license to copy and make use of the original content I have created in this specific downloadable file and make derivative works of it as you wish provided you retain any included attributions in substantially similar works :-).

17 thoughts on “Deploy This Silverlight Application on Windows Azure in 10 minutes – no Tools Required!

  1. Smooth deployment, except 1 minor point.

    Suggested configuration XML has 1 syntax error. There is wrong xml symbol “ after second PrimaryAccessKey“.
    In order to make it work I had to replace it by symbol “.

    Thank you,

  2. Cool program
    I had one problem with the xml I had to copy, the last quotation mark was giving a syntax error when saving. Swapping with a standard quotation fixed the problem.

  3. Very nice tutorial, Colin! You mentioned a few ways for getting tokens. I would expect that there will be some people who don’t have easy access to the resources you listed for getting tokens. Are tokens still available through the main Windows Azure website (http://www.azure.com) as well?

    (I am contracting for M80, working with Microsoft to promote Windows Azure)

    • Much thanks! I’ll be sure to pass this info on, as well as a link to your tutorial.

      From what I’ve seen, the tokens are taking closer to a few weeks (as opposed to a few hours, like the website says), but Microsoft is probably getting overwhelmed with requests and needs to throttle the usage considering they are still in CTP.

  4. First, thanks much for this blog post. Second, I’m *so* close to uploading a friend’s quiz application, but am having trouble on Step 5.

    Specifically, I have the files requried to run the applications, but I don’t have the files you’re uploading in Step 5 (cspkg and cscfg). Are these files from the source VS solution?

  5. Hi Tom.

    To get the files, you need to select the Cloud project in your solution, right-click and select Publish.
    This will:
    1 Package the files as it does for a debug run
    2 Launch your default browser to windows.azure.com (though you may have done this already)
    3 Open Windows Explorer on the folder containing the two files you need for the web portal

  6. At this point, I do not have a Cloud solution. I only have the files required to run the Silverlight app. I’m guessing – please correct me if I’m mistaken – that I need to do the following:

    1. Get the source from my co-worker – specifically the VS solution/project
    2. Add a Cloud project
    3. Point the deployment project at the Silverlight project
    4. Then follow your instructions regarding publishing

    Is that correct or is using VS the only way?

  7. I just tried to upload your Silverlight app and everything appears to work until I attempt to run the application. At this point, I get an error message stating “Couldn’t retrieve wall messages – try again later”. The app appears, but I can’t click on it to add messages or see any existing messages.

Comments are closed.