How To Deploy the myToDo Sample Azure Application

myToDo ASP.NET MVC Sample Application

by Shawn Duggan on 11/15/2009

I recently decided to learn a bit more about Azure.  There is a lot of information, tutorials and videos at the Getting Started site.  I watched some of the videos and thought it didn’t look too bad.  I followed the links to install the SDK and download the sample myToDo application.

After opening the sample myToDo code I wanted a bit more help in understanding things, so I also downloaded the Windows Azure Platform Training Kit.  It also had the myToDo sample in there preconfigured and ready to install (its the DeployWindowsAzure demo).  It contained a demo script which walked through how to redeem tokens and deploy the application into Azure.

I didn’t want to install the package from the demo, so I compiled and tested my local application using the development fabric.  It wasn’t too difficult.  Where things went wrong for me was in the deployment.

I was following the “Demo Script – Deploy ToDo” document included in the DeployWindowsAzure demo.  It did a good job of walking me through creating my Azure account and setting up my services.  Things weren’t too bad at all, or so I thought.

Like most applications, there are development config settings and staging / production config settings.  Here is the out of the box ServiceConfiguration.cscfg file from the sample:

   1: <?xml version="1.0"?>

   2: <ServiceConfiguration serviceName="MyTodo" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration">

   3:   <Role name="MyTodo.WebUx">

   4:     <Instances count="1" />

   5:     <ConfigurationSettings>

   6:       <!--<Setting name="AccountName" value="todoliststorage"/>

   7:       <Setting name="AccountSharedKey" value="XbzT7DA/Y60SQOBdFHLNn1gQnWpQjfo3O+eDZ27ylDlpkEZ29x72Aj26IquDAYWUeQLuKtMfeBGzTttUHpFuOw=="/>

   8:       <Setting name="BlobStorageEndpoint" value="https://todoliststorage.blob.core.windows.net"/>

   9:       <Setting name="QueueStorageEndpoint" value = "https://todoliststorage.queue.core.windows.net"/>

  10:       <Setting name="TableStorageEndpoint" value="https://todoliststorage.table.core.windows.net"/>

  11:       <Setting name="InitialListsBlobUrl" value="https://todoliststorage.blob.core.windows.net/initialdata/taskLists"/>-->

  12:       <Setting name="AccountName" value="devstoreaccount1" />

  13:       <Setting name="AccountSharedKey" value="Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==" />

  14:       <Setting name="BlobStorageEndpoint" value="http://127.0.0.1:10000" />

  15:       <Setting name="QueueStorageEndpoint" value="http://127.0.0.1:10001" />

  16:       <Setting name="TableStorageEndpoint" value="http://127.0.0.1:10002" />

  17:       <Setting name="InitialListsBlobUrl" value="https://127.0.0.1:10002/devstoreaccount1/initialdata/taskLists" />

  18:     </ConfigurationSettings>

  19:   </Role>

  20: </ServiceConfiguration>

The settings “As Is” worked for running my application locally.  When I deployed simply mimicked the commented out end point settings above.  I replaced “todoliststorage” with the name of my application, saved things and waited.  Unfortunately my service would never stop initializing.  Nothing worked.

After much lost time, and a gentle prod from @rbuike (thanks Rodney) I watched the deployment video and saw the config settings being used in the video were different.  I corrected my settings to match and things worked great.

Use the settings below for your myToDo application instead.  Note that the end points have no reference to what your service is called.  Hopefully the sample code will soon be corrected so others are not also mislead.

   1: <?xml version="1.0"?>

   2: <ServiceConfiguration serviceName="MyTodo" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration">

   3:   <Role name="MyTodo.WebUx">

   4:     <Instances count="1" />

   5:     <ConfigurationSettings>

   6:       <Setting name="AccountName" value="[YOUR STORAGE ACCOUNT NAME]"/>

   7:       <Setting name="AccountSharedKey" value="[PRIMARY KEY]"/>

   8:       <Setting name="BlobStorageEndpoint" value="https://blob.core.windows.net"/>

   9:       <Setting name="QueueStorageEndpoint" value = "https://queue.core.windows.net"/>

  10:       <Setting name="TableStorageEndpoint" value="https://table.core.windows.net"/>

  11:       <Setting name="InitialListsBlobUrl" value=""/>

  12:     </ConfigurationSettings>

  13:   </Role>

  14: </ServiceConfiguration>

Good luck!

  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Add to favorites
  • RSS
  • StumbleUpon
  • Twitter
  • Tumblr
  • email
  • LinkedIn
  • Netvibes
  • Posterous
  • Suggest to Techmeme via Twitter
  • Technorati

Leave a Comment

Previous post:

Next post: