RIA and Windows Azure

Earlier this week it was announced that Windows Azure now supports .NET 4. I figured a few of you would want to know how you could write a RIA Services application that ran on the cloud, so I thought I’d put something simple together to get you started. This post covers creating and modifying a RIA business application to run on Windows Azure. I’m assuming you already have some familiarity with Azure, the website, and the tools. If not, a couple great places to start are the official home page and Jim’s blog.

Creating a Business Application for the Cloud

These steps show how to create a business application project targeted at the cloud and ready for local development. Steps 2 and 3 can also be followed to modify a preexisting business application for the cloud.

  1. Create a new business application using the ‘Silverlight Business Application’ template
  2. Add a new Project to the solution using the ‘Windows Azure Cloud Service’ template
    1. In the wizard, select ‘OK’ without adding any roles
  3. From the Cloud Service project ‘Roles’ folder, add a Web Role Project from the solution and select the Web project you want to target at the cloud


Preparing a Business Application for Deployment

At this point, you should be able to run the application in the Azure development fabric. To prepare the application to run in the cloud, there are only a couple other updates that must be made.

  1. For each RIA Services assembly referenced by the Web project, open the Properties window and set Copy Local to True
  2. Modify the ASP.NET providers to use Azure Table storage following steps 1 – 4 of Jim’s post on using Sample Windows Azure ASP.NET Providers
  3. In step 3, add a reference from your Web project to the AspProviders sample library
  4. In step 4, you do not need to include the session state provider and should update the profile provider instead
    <profile defaultProvider="TableStorageProfileProvider">
        <add name="FriendlyName"/>


        <add name="TableStorageProfileProvider"
             description="Profile provider using table storage"

Also in step 4, be sure to update the appSettings to match the values specified on your storage account summary page. When setting the endpoints, you will need to use the https scheme (e.g. https://accountname.table.core.windows.net).

Next Steps

At this point you should be able to deploy your business application. This MSDN topic will help guide you through deploying a cloud service from Visual Studio when you’re ready.

One more thing to consider before deploying is whether you need to migrate your data to Azure. There are plenty of guides out there for this so just look around.

Finally, if you’re interested in Logging and Tracing on Windows Azure, I found this MSDN article by Mike Kelly particularly helpful.

That’s all for this post. In part two I’ll help you get started using RIA with Windows Azure and SQL Azure.

Comments (6)

  1. Nick says:

    This has been driving me crazy. I followed the example, but I keep getting the following error:

    line: 56

    Error: Unhandled Error in Silverlight Application

    Code: 2103    

    Category: InitializeError      

    Message: Invalid or malformed application: Check manifest    

    The Business App runs fine outside of the development fabric.

  2. Nick says:

    Actually, this looks like it may be an IIS configuration problem. The app runs fine on the Visual Studio Development Server, but when I use the Locall IIS web server, I get the same error as the when trying to run on the development fabric.

  3. Nick says:

    Problem solved, it was an IIS configuration problem. I added IIS Metabase and IIS 6 Configuration compatibility and all the Common HTTP Features and now it works!

  4. Alex says:

    I follow the tutorial but have an exception:

    Error 36 The "CreateRiaClientFilesTask" task failed unexpectedly.

    System.Web.HttpException (0x80004005): Unrecognized configuration section membership. (c:userssenatorovdocumentsvisual studio 2010ProjectseLifeAzureeLifeSBA.Webweb.config line 22) —> System.Configuration.ConfigurationErrorsException: Unrecognized configuration section membership. (c:userssenatorovdocumentsvisual studio 2010ProjectseLifeAzureeLifeSBA.Webweb.config line 22)

      at System.Web.HttpRuntime.HostingInit(HostingEnvironmentFlags hostingFlags, PolicyLevel policyLevel, Exception appDomainCreationException)

      at System.Web.Compilation.ClientBuildManager.EnsureHostCreated()

    Help pls.

  5. Alex says:

     <membership defaultProvider="TableStorageMembershipProvider" userIsOnlineTimeWindow = "20">



         <add name="TableStorageMembershipProvider"

    line 22

  6. kylemc says:

    Can you send me the Web.Config file? Just use the 'Email Blog Author' link and I'll email you back.