Deploying to Windows Azure

Windows AzureMicrosoft is expected to remove the CTP from their Azure Platform this month at PDC in Los Angeles. Until then, you can still receive access to their free cloud services platform. To get started with Azure you need a Windows Live ID and signup with Microsoft Connect to receive an access code (aka tokens).


Microsoft Connect

When you receive your access token, you can begin creating projects on the Azure platform with the Azure Developer Portal. You can only create one project with the CTP, but you can have multiple services inside each project (web/worker roles).


Azure Projects

After you’ve created your project in the developer portal, you can add services which will be the endpoints you deploy to for Windows Azure. We will add a Windows Azure Service in this example.


Windows Azure Add Service

To create our Windows Azure application, we need to create a package (cspkg) that contains our application contents and a configuration definition (cscfg) that defines our roles. Microsoft has created Azure tools to assist in generating the package and configuration file. You can download the Azure SDK to create Azure applications using Visual Studio. The Azure SDK allows you to run your own local development fabric before pushing your application into the cloud. Eclipse also has its own Azure Tools if you prefer to develop in the Eclipse environment.

After installation of the Azure Tools, you now have a new project template “Cloud Service” which we’ll use to create our web role.


Visual Studio Cloud Service Template

After providing a name for your Cloud Service project, you are prompted to select which roles you would like to use. We will choose “ASP.NET Web Role” for this example.

Azure Roles

After clicking “Ok”, you will now have a Cloud Service project and a Web Role project in your solution. We will now remove the Web Role for this exercise, and replace it with an existing ASP.NET application called ASP.NET Chart Controls which Scott Guthrie announced last year. This application did not work on the PDC release of Azure, but Azure now allows web applications to run in Full Trust with some minor tweaking.


ASP.NET Chart Controls Solution

We now have our solution complete and have one web role we would like to deploy to the cloud. We must now publish the solution to Azure. We right-click on the Cloud Service project and click “Publish” which opens up the Azure Developer Portal.

After logging in with Windows Live, you want to deploy your application to the Staging Environment before pushing it live. To deploy, you simply select the application package (cspkg) and configuration definition (cscfg) from your “/publish” folder in the cloud service “/bin/Debug” directory.


Azure Package and Configuration Selection
Azure Package and Configuration

Clicking on “Deploy” will load the Azure package and service definition to the cloud and create a VM necessary to run the application. The environment takes some time to setup and will show its state as “Initialization” until the VM is entirely ready. You are given a URI based upon a randomly generated GUID to view your application and test it before moving it into production. Having two environments is nice if you also have database changes that need to coincide with your deployment.


Azure Staging Environment

Once the application has been verified, you can click the center arrows icon to swap the Staging site into Production. You can see the two environments have now been switched.


ASP.NET Chart Controls Azure

Azure does make the deployment process a bit more involved, but there is an managed Azure Deployment API in the works to automate the build and deploy steps you may need in your organization. You can view our sample ASP.NET Chart Controls application running on Azure Services (cloudapp.net). Kudos to Microsoft for allowing full trust applications! We will be watching for more exciting features from the Azure Team.

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Twitter

Filed under: Application Development, Microsoft | Posted on November 2nd, 2009 by AaronH

Tags: , , , , , ,

One Response to “Deploying to Windows Azure”

  1. Another Says:

    Title…

    Very interesting post. I would like to link back to it….

Leave a Reply

Links

Topics

Tags

Authors

Syndication

Archives

Copyright © 2010 Pearl Technology. All rights reserved.
The Tech Blue theme was modified to help create this blog.