windowsazurecloudcloud-hostingazure-web-app-service

Migrate Azure Web Site to Azure Cloud Service


I have a project and I'm planning to start the web app as an Azure Web Site and then migrate it to an Azure Cloud Service (also called Hosted Service) if it is needed as a scale strategy.

The decision is because I read that Azure Web Sites are more simple and fast to develop with almost no Azure-specific configurations or code. So starting fast and simple is a good starting point for the project.

But, is that a good starting point for you? Is migrating an Azure Web Site to an Azure Cloud Service the same as you were migrating a normal ASP.NET Website to an Azure Cloud Service? Would you start with an Azure Cloud Service right from the beginning? If yes, why?

Thanks for your time.


Solution

  • There are benefits to both deployment models, it will eventually come down to what you are trying to achieve and ultimately the success of your application.

    Below I've outlined the Pros and Cons of each of the models to ensure that you're making the right choice for your applications goals.

    Windows Azure Web Sites

    You have properly identified that Windows Azure Web Sites is a great starting point for an application, however you could also consider that Web Sites does offer enough scalability for many solutions.

    Pros

    Cons

    Windows Azure Cloud Services

    Cloud Services (formerly known as Hosted Services) is definitely the vision for the future of Web Applications. It is built with resiliency in mind to keep the cost of applications affordable by scaling to meet demand, and dial back capacity when your traffic slows.

    Pros

    Cons

    Things to consider for Portability

    The items above might have given you enough to plan the immediate future of the application and it is very likely that you might want to consider Cloud Services in the future (it fits a number of application scenarios better in the long run).

    Here is a list of things to help portability between Web Sites to Cloud Services:

    1. Start thinking Stateless

      Windows Azure Web Sites is nice as it is a persistent environment, which means you are able to store things like session state and assets to the disk.

      Although this is a good feature, it's best to start planning towards a stateless application, if your end goal is to be in Cloud Services. Here are a few things you can do to start thinking stateless:

      • Don't rely on Session State
        • If you need it, come up with a strategy to make it scale (Caching Service, SQL, or Storage)
      • Use the Storage Service
        • Assets such as Static HTML, css, javascript and images are better placed in Storage
          • Avoids additional bandwidth on your Web Site (potentially stay shared longer for lower cost)
          • Can be CDN Enabled, provides a better experience for International markets
          • Easier to update web assets when application is migrated to Cloud Services
        • Storing User content
          • If your application already stores to the Storage Service, there is one less code modification in the future when moving to cloud services.
    2. Make it easy to discover patterns in your Data

      The benefit of Cloud Services is it enables you to reduce cost by only scaling what needs scaled. Starting the process of identifying your scale units i.e. How you partition your database or Tables in Storage.