Deploying My First Windows Azure AppFabric Application

In my last post I walked through the basic steps on creating my first Windows Azure AppFabric Application.  In this post I’m going to walk through the steps to get that basic application deployed and running in the new Windows Azure AppFabric Application Manager.

Before I get started, I wanted to point out a few important things:

To get started, I need to go to the AppFabric labs portal at  From there I go to the “AppFabric Services” button on the bottom of the page, and then the “Applications” button in the tree menu on the left.  I had previously requested and been granted a namespace, so my portal looks like the screenshot below:

I noticed that I had namespaces related to Windows Azure storage and SQL Azure.  This is separate from any other storage or SQL Azure you may already have.  The CTP labs environment provdes one SQL Azure database to get started with, but you can’t create new databases as the provided user doesn’t have the necessary rights (see this forum post for additional details).  I can access Access Control Services v2 by highlighting my namespace and then clicking on the “Access Control Portal” green toolbox in the top ribbon.  To launch the Windows Azure AppFabric Application Manager, I simply highlight my namespace and then click on the “Application Manager” blue icon in the top ribbon.  Let’s do that.

From here I can see any Windows Azure AppFabric Applications that are deployed as well as some application logging (within scope of the AF App Manager).  In order to create a new application, I can click on the “New Application” link on the Application Dashboard, or also the “New Application” option under the “Actions” menu in the upper-right hand corner of the dashboard.

Let’s assume for now that I am not complete with my application, but I would like to reserve the domain name.  This is similar to creating a new Windows Azure hosted service (reserves the domain name but doesn’t require a package be uploaded to Windows Azure at the time).  When I create that new application, I am presented with a dialog that lets me upload the package and specify the domain name I’d like to use.

When I click on the “Submit” button, I will see a progress dialog to show me the status of the package creation.  This only takes a few seconds.

Now that my application is created in the Windows Azure AppFabric AppManager, I can click the name of the application to open a new screen containing all sorts of details about the application.

From this screen I can see properties related to the application, any containers used by my application (great explanation in Neil’s blog post), the endpoints I have created, any referenced services, as well as some monitoring metrics for my application.  At this point these fields are empty since I haven’t deployed anything yet.  I also noticed that I can drill into details related to logging, certifications, or scalability options by navigating the links on the menu on the left side of the window.

In my last post I created a very simple ASP.NET MVC application that uses SQL Azure and Windows Azure AppFabric cache.  I would now like to take my application and deploy it to the Windows Azure AppFabric Application Manager.  To do so I have two options – publish from Visual Studio 2010 or upload the application via AppFabric Application Manager.  For the purposes of this initial walkthrough, I decided to use the AppFabric Application Manager.  I click on the “Upload New Package” link and am prompted for the path to the AppFabric package.  I figured the process to get the package would be similar to that of a standard Windows Azure application – from Visual Studio, right-click on my cloud project and select “Publish” and choose to not deploy but just create the package.  I would be wrong.  In the June CTP for AppFabric Applications, it doesn’t work like that (personally I hope this changes to be more like standard Azure apps).  I’ll need to get the path to the AppFabric package (an .afpkg file) from the build output window (or browse to the .\bin\Debug\Publish subdirectory of the application).

Now that I have the package, I can upload it via the AppFabric Application Manager. I’ll receive a nice progress dialog while the package is being uploaded.

Once uploaded, I received a dialog to let me know that I’ll soon be able to deploy the application.  This is somewhat similar to traditional Windows Azure applications – I first upload the package to Windows Azure and then I can start the role instances.

Note: While working in the AppFabric Manager I did notice there is no link back to the main portal.  I found that kind of “funny” since there was a link from the portal to the AppFabric Manager.  I opened a second browser tab so I could have the portal in one and the manager in another.

Now that my application is imported into the Windows Azure AppFabric Application Manager, I will need to deploy it.  I can see in the summary screen for my application the various aspects of my application.  In my case I can see the services (the AppFabric cache and SQL services) and endpoints (my ASP.NET MVC app endpoint).  I also notice the containers are listed as “Imported”.

In order to deploy my application, I simply click the “Deploy Application” link on the Summary screen. Doing so will bring up a dialog showing what will be deployed, along with an option to start the application, or not, after the application is deployed.

While deploying the application I noticed the State of each item under Containers update to “Deploying…”.  This process will take a few minutes to fully deploy.  The State changed from “Deploying” to “Stopped” to “Starting” and finally “Started”.

This process takes about 10 minutes to get up and running and usable.  Most of that time was spent waiting on DNS to update so that I could access the application.  It was about 4 minutes to go from “Deploying” to fully “Started”.

Now my application is up and running!  I didn’t have to mess with determining what size VMs I wanted, how many instances, or any “infrastructure” stuff like that.  I just needed to write my application, provide credentials for SQL Azure and AppFabric Cache, and deploy.  Pretty nice!  This is a very nice and easy way to deploy applications without having to worry about many of the underlying details.  Azure AppFabric Applications provide a whole new layer, and a good one in my opinion, of abstraction on the Windows Azure platform.  It may not be for every app, but I certainly feel is fits a good many applications.

UPDATE 7/13/2010: Corrected statement related to use of AppFabric CTP provided SQL Azure and storage accounts.