Click here to Skip to main content
15,867,141 members
Articles / Web Development / ASP.NET

Hello Windows Azure

Rate me:
Please Sign up or sign in to vote.
4.71/5 (14 votes)
27 Oct 2009CPOL4 min read 91.6K   828   50   18
An introductory article on Windows Azure - a cloud computing initiative by Microsoft

Introduction

Cloud computing is steadily emerging as the next big thing in enterprise software arena. Many companies have already launched their own versions providing a wide variety of features.

Cloud Computing LandScape

*Image courtesy - Wikipedia

Microsoft has launched a CTP (Community Technology Preview) that is available for signup at www.azure.com. The biggest advantage presented by Azure is a very quick developer ramp up, as .NET developers can very easily learn new cloud based computing features. Also huge existing code base of customers can be reused and quickly scaled up to the cloud platform using Azure.

The intension here is to demonstrate my understanding of Azure in a series of small tutorials moving from simple to complex topics. In this first article, I shall demonstrate how any individual knowing .NET can create a simple "Hello World!" on Azure Platform.

Step 1 - Signup and Get Started!

Azure is based primarily on 3 kinds of services:

  • Windows Azure: Provides compute and storage platform
  • SQL Services: Provides SQL and data storage related services
  • .NET Services: Provides service bus and access control features

Many other services and SDKs may be available in future on Azure like SharePoint, etc.

To get the invitation code, one needs to register at www.azure.com and subsequently follow the instructions given on the site to receive invite code.

Azure Signup

Step 2 - Installing Pre-requisites

Links for Azure Development tools and SDK are available on www.azure.com. Also you can download tools from here. To install these tools, you need at least Visual Studio 2008 on Windows Vista SP1 or Windows Server 2008 or Windows 7.

Step 3 - Creating Project

Once pre-requisites (tools & SDKs) are installed, the Cloud related projects become available in Visual Studio. Start Visual Studio and create a C# "Cloud Service" project with a suitable name.

Create Cloud Service Project

You shall be asked to select a role. Azure provides mainly 2 types of roles:

  • Web Role: It is more like a Web Application where you get Web Pages, code behind and other web related services.
  • Worker Role : It is more like a Windows service which once started will keep running and perform the tasks you wish.

Your application may contain either one of these or both, depending on functionality you wish to create. Currently in the CTP, the maximum roles your project can have is limited to 2.

In our case, as we are creating a Web App, we select "Web Role" and continue to complete project creation.

Select Web Role for Cloud Service Project

Step 4 - Implementation

Your project created contains many files including "ServiceDefinition.csdef" which is very interesting. We keep it unchanged and continue to web page 'Default.aspx'. Drop a label from toolbox to the page.

Drop Label in Default.aspx for Cloud Service Project

Double click the page and within Page_load(..) function, add this line:

C#
this.Label1.Text = "Hello World! Welcome to Azure!"; 

Step 5 - Debug and Test

Debugging this code is similar to regular ASP.NET Web Application, just press F5. It will launch the 'Execution Fabric' simulated cloud environment of Microsoft.

Debug Cloud Service Project

Step 6 - Deploy

Right click the project and in Visual Studio, select 'publish' from the pop-up menu. Once 'Published', Visual Studio shall create HelloAzureService.cspkg and ServiceConfiguration.cscfg files. One may then logon to www.azure.com and create Windows Azure project if not already created. To deploy these files on the cloud, upload the generated (.cspkg and .cscfg) files as shown below. More information on deploying Azure services is available here

Deploy Azure project

Once you click upload, the following screen appears:

Deploy Azure project

It takes a while before the application is deployed and one has to be a little patient. Once WebRole1 status is updated to 'Started'; you may test your application in staging more itself by clicking the given URL - http://6c0873bd9a2d47d7a38e1a87af9c0b35.cloudapp.net/. Further you may deploy the application by moving to production mode, if you are satisfied with it during the staging mode. Below is a screenshot of the application running in staging mode.

Deploy Azure project

Points of Interest

As one may realize, it is very easy to ramp up to cloud computing using your existing expertise in .NET Framework. More information and analysis about cloud computing is available at my blog.

History

  • 25 Oct 2009 - Finally got some time! Completed the article and uploaded v 1.0
  • 23 Oct 2009 - Created first outline of the article

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect Symantec
India India
Software Architect

- Instrumental in transforming various concepts to successful concrete products/features.
- Passionate about quality in everything from the requirement specification to the end product.
- Involved with wide range of technologies and domains.
- Likes to think from customer or end user perspective.


Specialties: Architecture & Design, Web Services, Cloud Computing, C++, COM, C#, .NET
Clouds: Microsoft Azure, Amazon, Google App Engine
Other Interests : Linux, Java, HTML, PHP, Javascript and other cross platform technologies.


Connect with me @ LinkedIn

Comments and Discussions

 
GeneralGood Work For Beginner Pin
Abdul Quader Mamun16-Dec-10 2:37
Abdul Quader Mamun16-Dec-10 2:37 
GeneralRe: Good Work For Beginner Pin
Zamshed Farhan15-Jan-13 3:11
Zamshed Farhan15-Jan-13 3:11 
NewsSecond Article in this series - Windows Azure Storage [modified] Pin
bhavik1st21-Nov-09 19:13
bhavik1st21-Nov-09 19:13 
GeneralUrl Question Pin
D-Noc3-Nov-09 8:30
D-Noc3-Nov-09 8:30 
GeneralRe: Url Question Pin
bhavik1st5-Nov-09 9:03
bhavik1st5-Nov-09 9:03 
Questionbenefits? Pin
Yang Yu27-Oct-09 5:57
Yang Yu27-Oct-09 5:57 
AnswerRe: benefits? Pin
Goran Bacvarovski27-Oct-09 8:50
Goran Bacvarovski27-Oct-09 8:50 
GeneralRe: benefits? Pin
Yang Yu27-Oct-09 9:47
Yang Yu27-Oct-09 9:47 
GeneralRe: benefits? Pin
Goran Bacvarovski28-Oct-09 4:23
Goran Bacvarovski28-Oct-09 4:23 
AnswerRe: benefits? Pin
bhavik1st27-Oct-09 9:51
bhavik1st27-Oct-09 9:51 
GeneralRe: benefits? Pin
Yang Yu27-Oct-09 10:59
Yang Yu27-Oct-09 10:59 
GeneralRe: benefits? Pin
CARPETBURNER27-Oct-09 22:40
CARPETBURNER27-Oct-09 22:40 
GeneralRe: benefits? [modified] Pin
bhavik1st28-Oct-09 11:23
bhavik1st28-Oct-09 11:23 
Hi,

Some of us do realize that technically nothing new is there and cloud computing is a "fad"; but from business perspective its different game now as infrastructure and its initial costs are taken out of the scene.In a way it may also be a marketing gimmick for cloud companies to achieve vendor-lock-in.

We may never know whether cloud computing will succeed or not until it does - given many concerns like security and billing rates; but one thing is sure that for many startup's who cannot or do not heavily invest in infrastructure, may now be able cheaply publish useful applications. Not that hosting companies did not provide similar things earlier but there is a pay-as-you-grow feature which may sound attractive. Technology is now packaged much more conveniently as a "cloud" and made available to business.
As a solution architect it may reduce effort I spend in determining and setting up the infrastructure for particular solution for a customer.

But then, its just my humble opinion.

Regards,

// Bhavik Shah

modified on Wednesday, October 28, 2009 5:36 PM

GeneralRe: benefits? Pin
extremeg24-Nov-09 14:43
extremeg24-Nov-09 14:43 
GeneralRe: benefits? Pin
conrad Braam11-Aug-10 1:48
conrad Braam11-Aug-10 1:48 
AnswerRe: benefits? Pin
CARPETBURNER30-Oct-09 3:22
CARPETBURNER30-Oct-09 3:22 
GeneralRe: benefits? Pin
bhavik1st15-Nov-09 19:23
bhavik1st15-Nov-09 19:23 
GeneralRe: benefits? Pin
conrad Braam11-Aug-10 1:53
conrad Braam11-Aug-10 1:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.