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:
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
A Windows Azure solution is contained in a hosted service. Before deploying the the package we previously created, we’ll have to create the hosted service.
Creating the Hosted Service
- In the Windows Azure Management Portal, click on Hosted Services, Storage & CDN in the left-hand menu. From here, you can see all instances of roles that have been provisioned in your Windows Azure subscription.
- Click on New Hosted Service in the toolbar.
- Give the service a name. Let’s call it Nerd Dinner.
- We need to give the solution a URL prefix under the cloudapp.net domain. Choose a unique prefix. The portal will validate the prefix let you know if it is not available.
- Now choose a region from the region dropdown where the solution will be hosted. We created the database in the North Central US region, so let’s do the same for the hosted service.
- Keep the Deploy to stage environment option selected.
- Give the deployment a name (e.g. Nerd Diner v1.0).
- Click on Browse Locally under Package location. Locate the folder to which Visual Studio published the service package and configuration file and select the NerdDinnerCloud package file. Click OK.
- Click on Browse Locally under Configuration file. Locate the same folder as the previous step and select ServiceConfiguration.cscfg. Click OK.
- The service configuration file will now be validated. You’re going to get a warning about only having one instance in your solution. Click Yes to override and submit your solution for provisioning.
- Windows Azure will now provision the instances. You can follow the provisioning status from the portal.
- After a few minutes, you’ll see the status as Active. Your solution is now deployed in the staging environment.
Testing the Solution in the Staging Environment
- From the Hosted Services page, click on Nerd Dinner (the one that is listed as Deployment under the Type column).
- In the Properties pane on the right, you’ll see a very long DNS name – that’s the DNS name that was created for your staging environment.
Why is the DNS name different than the one you provided when the hosted service was created? That name (URL prefix) is reserved for the production environment.
- Launch the solution by clicking on the DNS name. Test the application to make sure that everything is working similar to the test done in part 5.
After you’ve tested the solution in the staging environment, there is only one task left to do – promote the solution to the production environment.