16.4. Deployment

To deploy your application to the cloud, you will need a Windows Azure account. If you do not have one yet, what are you waiting for? Sign up for one now at www.microsoft.com/windowsazure/account/.

16.4.1. Deploying the Hello Azure Application

Before you deploy your application, check whether you have reset the instance count in the .cscfg file of the Hello Azure application from five to one, depending on your price plan; otherwise, you may receive an error when you upload your application.

OK, let's deploy the project you created earlier by right-clicking the HelloAzure project and selecting Publish. Visual Studio will build the application, open the publish directory folder in Windows Explorer, and send you to the Windows Azure platform login page. The Windows Azure portal allows you to deploy, configure, and manage your applications.

Once you have logged into the services portal, you should see a screen similar to Figure 16-9.

Figure 16.9. Azure portal

This page lists all the projects associated with this user. If you haven't created a project yet, click the link to add services to the project. In the previous example, I have a project called PDC08CTP; I can click this, and I will be taken to the project services screen (Figure 16-10).

Here, if you haven't already, click the New Service link, and add a new hosted service (in Figure 16-10 mine is called Introducing Visual Studio 2010). Then click it.

You should then be taken to a screen that shows the current status of your Azure roles (Figure 16-11).

Figure 16.10. Project services screen

Figure 16.11. Inactive web role

Notice at the moment this screen shows only the production instance (see the following section for how to upload to the staging instance). You want to upload your application to Windows Azure, so click the Deploy button beneath the staging cube, and you will be taken to the Staging Deployment screen.

You now need to upload your application itself and its service configuration file.

16.4.1.1. Application Package Section

In the Application Package section, click the Browse button, and select the compiled application's .cspkg file (by default this is built at ~inDebugPublish). See Figure 16-12.

Figure 16.12. Uploading service configuration files

16.4.1.2. Configuration Settings Section

In the Configuration Settings section, click the Browse button, and select the ServiceConfiguration file (default location: ~HelloAzureinDebugPublishServiceConfiguration.cscfg). Now give the deployment a descriptive label (e.g., v1.0.0) and click Deploy. Your service will now be deployed to the cloud (Figure 16-13). This is not the quickest process, so you may want to go and do something else for five minutes.

Once your application has been uploaded, a number of new options will appear beneath the cube enabling you to configure and run it (Figure 16-14).

Figure 16.13. Screen after uploading an application

Figure 16.14. Screen after role has been uploaded

Click the Run button to start your Azure application. Azure will chug away for a bit, and then your application should be running (Figure 16-15). Notice that beneath the cube is a URL that you can click to be taken to your running application.

Figure 16.15. Our web role running in the cloud

16.4.2. Staging

Normally you will want to test your changes before moving them to production (or you probably should), so Windows Azure allows you to deploy applications to a staging deployment as well (Figure 16-16). To access the staging deployment, click the arrow on the right of the project management screen to show the staging options, and upload in a similar manner similar to what you just did.

When you want to promote your staging application to production, click the blue sphere with the two white arrows in the middle. After accepting a confirmation that you really want to do this, Windows Azure will then move your staged application into production.

Figure 16.16. Azure allows production and staging environments.

16.4.3. Production URLs

Obviously you will want to configure your application to run at your own domain name. At the time of writing, there was no easy facility to do this (apart from by domain forwarding), so please consult the Azure online documentation for details of how to do this.

16.4.4. Analytical Data

A big omission, in my opinion, is the current lack of analytical data available in Azure, which is crucial given its pay-per-use pricing model. In the future, it is likely Microsoft will add this (indeed earlier previews contained an Analytical tab).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.4.135