Wednesday, February 18, 2009

Hello World – Building Azure Services Part I

I am very excited about the cloud platform that Microsoft announced in PDC 2008 which I also blogged about earlier. MS also released the Windows Azure SDK (Jan 2009 CTP), Windows Azure Tools for Visual Studio 1.0 (it works with Visual Web Developer Express 2008 SP1) and the Windows Azure Training Kit (Feb 2009 Update). Start by reading about Windows Azure and see how it works. Then go get the tools and install them. Then, let the fun begin…

Hello World project

Just follow the steps to create our first HelloWorld Cloud Service project:

1. Open Visual Studio 2008 or Visual Web Developer Express 2008.

2. Click New Project. Under Visual C# node, select Cloud Service. Then, select Web Cloud Service from the right hand pane of installed templates.

3. Give your project the name HelloWorld and a desired path to store the project.

4. Your first Cloud Service project is created.

5. Open the default.aspx page from the HelloWorld_WebRole project and change the page title between the <title> tags to “Hello World” and also type in the text “Hello World!” between the <div> tags.

6. Hit F5 to start your Windows Azure application in debug mode.

7. The Development Fabric and the Development Storage will start automatically. They will remain in the system tray.

8. You might see a popup like this when the Development Storage is setup for the first time.
Azure Development Storage Initialization

9. You will see a web browser window open up with your web application.


10. Now, right-click the imageicon and click “Show Development Fabric UI” to open the Development Fabric. Note the IP Address of the HelloWorldContract points to the HelloWorld application we just created.


Some details about the project we just created:

The structure of the solution and notice that VS creates two projects – HelloWorld and HelloWorld_WebRole. HelloWorld_WebRole is a ASP.NET web application project. It contains a ServiceConfiguration.cscfg and ServiceDefinition,csdef files.

The ServiceDefinition.csdef file contains the metadata needed by the Windows Azure fabric to understand the requirements of your application, such as which roles are used. It will also contain configuration settings that apply to all instances.

The ServiceConfiguration.cscfg file lets you set the values for the configuration settings and the number of instances to run for each role.

This wraps up Part I where we created our first Windows Azure Cloud Service application. Check back for Part II shortly.

No comments:

Post a Comment