Deploying-a-Simple-Application_thumb[1]

If you’ve started reading from this post, you’ll need to go through the previous parts of this series before going starting this one:

Introduction
Part 1: Setting Up a SQL Azure Server and Database
Part 2: Scripting the On-Premise Database for SQL Azure
Part 3: Executing the Scripts on the SQL Azure Database
Part 4: Creating the Cloud Solution
Part 5: Testing Locally
Part 6: Preparing the Deployment Package
Part 7: Creating the Hosted Service

We’ve now verified that the solution works perfectly in the staging environment. Not only is the staging environment good for testing the application before it goes live, it’s a requirement for those of you who need to demonstrate to clients or regulators that the solution has been tested in an isolated environment and that all tests have passed.

With that said, let’s go ahead and promote the solution to the production environment. Once the promotion is done, you’ll be able to access the solution via the URL you established in part 7.

Promoting to the Production Environment

(If this part is not a dream come true in terms of how easy it is to migrate from staging to production, then I don’t know what is!)

  1. From the Hosted Services screen, click on the Nerd Dinner v1.0 deployment.
  2. Click on Swap VIP in the Deployments group of the toolbar.

    image

    Notice, the production line is empty – which makes sense since we don’t have any production instances of the solution running. If we did, the deployment name would show and this process would effectively swap the staging version of the solution (a.k.a. the new solution that we want to put up) with the current production version (a.k.a. the solution that we want to replace).

  3. Click OK.

Within a few seconds, you’ll see that the deployment shows Ready and that the Environment shows Production.

You’re done! Don’t believe it? Test it.

Testing the Production Application

  1. Click on the Nerd Dinner v1.0 deployment and look at the DNS name in the Properties pane. It now shows the DNS name that you reserved when you created the hosted service.
  2. Click on the DNS name it to launch the solution in the browser.

    image

If you get a DNS error within the first little while after you promote the solution to production, don’t worry. Nothing has gone wrong – the subdomain just hasn’t had time to propagate to the DNS servers used by your ISP. After about 5 to 10 minutes, the solution should come up with no problems.

Once you’re done testing the application and exploring all of the features and functions of the Windows Azure Management Portal, you should remove the web instance and SQL Azure server and database so as to not incur any charges on your credit card. We’ll go through that next.