Thursday, April 25, 2013

Journey to the Cloud with Windows Azure - Scenario I - Azure Cloud Services




One of the responsibilities in my new job is to help customers adopt and migrate to Windows Azure.  A majority of our customers choose Windows Azure as the cloud platform for optimizing costs while improving the performance and scalability of their apps.
   
While it would be great to architect an app ground up for the Azure platform, real life customers have a lot of their existing apps that need to be migrated. 

Typical customers’ on premise applications are web applications developed in .NET 2.0, .NET 3.5 or .NET 4.0 running SQL Server as the back end.  Some of the apps also have middleware services built using Web Services or WCF Services. 

There can never be a complete architecture without integration of existing LOB Applications.  Not surprisingly, most of these apps have integration with their internal AD, LDAP or other authentication subsystems. 

Most of these apps were developed in days where the organization had lesser man power, more time to manage and fewer demands for these systems. With the increase in employee workforce, more and more demand for these applications, the decision to move to cloud becomes all the more important.
But the biggest question customer’s face is how does one go about re-architecting these systems for Windows Azure? 

In the following series of posts we will see where each of the components fit. We'll delve through different scenarios and also on which Azure offering best fits the scenario.

Scenario I
A Retail customer has several of his web applications written using .NET Framework with SQL Server as backend. The applications are enterprise applications which are multi-tiered, with several scheduled jobs that are run in backend. The application is architected well using Best Practises prescribed by Microsoft.
The following are some of the top challenges he is facing currently and evaluating the options for moving to cloud:
1. The web applications are being used by customers world-wide and the performance becomes a concern many times, during Promotional offers.
2. The customers using the applications are increasing by time and its becoming difficult to increase the hardware for scaling out the applications.
3. Managing IT operations costs is becoming huge and this needs to be optimized

Which Azure offering best suits this scenario?

With this scenario, we see the first and foremost component to be migrated are   Web Applications – typically built using ASP.NET 3.5 or ASP.NET 4.0 in the recent past using Visual Studio 2008 or Visual Studio 2012.  This looks a straight forward candidate for Windows Azure Cloud Services.

Windows Azure Cloud Services offers Virtual Machines or what we call as Web Roles that run your ASP.NET Applications on the cloud with little bit of additional packaging and configuration.
The scheduled jobs and other start up tasks that the customer runs are taken care by what are called as Worker Roles, which are basically Windows Services that are run in Virtual Machines.

The "How" part:

For migration to cloud using Cloud Services, all you need is Visual Studio and the Windows Azure SDK (a free download toolkit that can be downloaded from here).  In case you are fine with command line utilities, you can even use the Windows Azure Powershell commandlet to compile and package your application to deploy in cloud services.  

You can download windows azure command line utilities from here.



As per the scenario in discussion,  you have an ASP.NET Application which reads data from SQL Server Database or any other Service.  There are also some scheduled jobs that need to be migrated. Both these applications ("Projects" in terms of Visual Studio) can be migrated by adding a Cloud Project Template (available in Visual Studio 2010/Visual Studio 2012).  You can even simulate the cloud platform using the Emulator that ships along with the Windows Azure SDK.  So, the first time you add the cloud project template and run the application locally, it would open up the emulator where you can see how, in the cloud environment the web roles would be provisioned.  Is this not awesome? Having seen how difficult it is with other cloud providers to simulate a "cloud-like" environment and debug in local machine, Windows Azure is definitely a boon!

Finally publishing to Azure is as simple as a right-click -> Publish from Visual Studio

In the spirit of DRY (do not repeat yourself - keeping things in a central place), I am going to provide the resource available in windowsazure.com for a step by step detail on migrating existing ASP.NET Applications to Cloud Services:


Summary
To sum this post, if you have an ASP.NET Application written using .NET 3.5 and above, the logical choice to port to Azure would be is to use a Cloud Service Project.

Moreover, Cloud Service Project offers the flexibility of using Remote Desktop to remote login and manage the virtual machine, in addition to setting up preconfigured installers that are required for the application (installing a reporting component or any dependant assembly).
Finally, if you want to migrate a three-tier application with Web Services/WCF Service in a separate Service or having them on-premise etc., then Windows Azure Cloud Service is your best bet.

Subsequent posts will concentrate on other scenarios that will best fit for Azure Websites and other Cloud Components.

Trivia: A Web Role can have multiple web applications hosted and a web application can be hosted in multiple web roles.



No comments: