Is Azure the New Silver Lining?, Page 3
With a hosted application created, you can start deploying your application to the cloud. The portal page gives an application ID number for each application you create through the portal. You will need this ID when copying it to the project page in Visual Studio (see Figure 5).
Figure 5: Setting the application ID in the Visual Studio project properties window.
The next step is to publish the Visual Studio solution to the portal. The easiest way to do this is to return to Visual Studio, right-click the project (either one will do), and choose Publish from the shortcut menu. This will create an application package from your solution, and open Windows Explorer to see the files in the bin\Debug\Publish folder under the solution directory.
In this folder, you will find two files: a .cspkg file for your application (this is a ZIP file that you can view after renaming the extension) and a .cscfg file for configuration settings. You will need both files to deploy your application to the cloud. You will also need to specify a label that can be something simple as "First version" or "With database connection."
After providing the files (the current CTP version sometimes requires you to upload the same configuration file twice with no apparent reason), the solution is loaded into a staging (testing) site. You also will get an URL for the staging server, such as http://4abf8928-af44-40af-bb43-a49685a2fc893.cloudapp.net/Default.aspx. To test your application, click the Run button on the portal and navigate to the URL given with your browser.
The portal page also has a promotion button (see Figure 6) that you can use to copy the application to the production server. After this promotion, your application will run on the production web address which you designated earlier (such as http://myfirstcloudapp.cloudapp.net/) when creating the application on the portal.
Figure 6: Promoting a web application from the staging server to production.
If you try this web address with your browser, you should see your Hello World application running in the cloud. Congratulations!
Service Types Explained
Now that you have learned how to create a quick and simple Windows Azure application using the web role (the ASP.NET application type), it's time to delve a bit deeper into the different services available on the Azure platform. As you will recall from the previous discussion, there are four service categories: Azure itself, .NET services, SQL services, and Live services.
The Azure service is probably the easiest to understand. With this service, you can create an ASP.NET application and a background application which can run constantly on the cloud and perform work on its own. The background role is useful for batch processing or computing, for instance. In addition to providing application execution services, the Azure service also supports rudimentary data storage using blobs, queues, and tables. These three ways to access data share a common web-based interface using a REST-like addressing (REST stands for Representational State Transfer). This means that you can access the data on the cloud from any application or programming language that can construct HTTP queries. Thus, the service isn't limited only to .NET code.