5 Simple Steps to Run your First Azure Program

No.of Views655
Bookmarked0 times
Downloads 
Votes0
By  questpond   On  12 May 2010 23:05:51
Tag : ASP.NET , ASP.NET MVC
In this article, we will look into 5 basic steps which will help us to run our first Azure program. In this article, we will understand how to create a simple web role application and while doing the same, we will understand some development concepts of Azure.
emailbookmarkadd commentsprint

Images in this article missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at info@codegain.com

 

Introduction

In this article, we will look into 5 basic steps which will help us to run our first Azure program. In this article, we will understand how to create a simple web role application and while doing the same, we will understand some development concepts of Azure.

If you are really lazy like me, you can download my two Azure basic videos which explain what azure is all about:

Watch my 500 videos on various topics like design patterns,WCF, WWF , WPF, LINQ ,Silverlight,UML, Sharepoint ,Azure,VSTS and lot more @ click here , you can also catch me on my trainings @ click here.

So let’s start with the 5 basic steps. By the way, when I wrote this article, it was 31st December, 10:30 evening, so Happy New Year and have a blast. Do not drink and drive, just drink, drink and sleep.

Step 1: Ensure That You Have the Proper OS and VS Edition

Windows Azure works only on Windows 7, Windows Server 2008 and Windows Vista. It does not work on XP currently. So ensure you have one of the above mentioned operating systems. Developers who are on XP, please do not attempt it. I have tried heavily but there is no way currently to execute Azure on XP. There are a lot of hacks which are given online, believe me, none of them work.

From Visual Studio aspect, ensure you have VS 2008 or VS 2010.

Step 2: Download the Windows Azure SDK

Windows Azure SDK simulates Azure hosting environment in your PC, so that you can develop your applications locally and then upload them online. So the first step is to download the SDK.

Once you install Windows Azure, you should see two menus - one of the development fabric and the other of the development storage.

Image Loading

You can also see the fabric and storage running on your task bar.

Image Loading

If you click on the same, you should be able to see the fabric and storage as seen in the below figure:

Image Loading

Step 3: Download Windows Azure Tools

We will need the cloud service Visual Studio template to speed up development in visual. So click on this link to download Windows Azure tools which will install the template in Visual Studio.

If Windows Azure tool is successfully installed, you should get the cloud service template as shown in the below figure:

Image Loading

Step 4: Create the Project

Once you have the cloud service template in your Visual Studio environment, click on it and select the ‘Web role’ as shown in the below figure. There are two kinds of basic applications you can create on Azure - ‘Web role’ and ‘Worker role’. Web role is nothing but a web application while worker roles are background processing applications like Windows processes.

To keep it simple, we have currently selected ‘WebRole’.

Image Loading

Once you are done, you should get two projects as shown below. One project is the cloud service project and the other is your web application. Cloud service project has associations to web and worker role projects.

Image Loading

The cloud service has two files, ‘ServiceConfiguration.cscfg’ and ‘ServiceDefinition.csdef’.

The ‘ServiceDefinition.csdef’ file contains the metadata needed by the Windows Azure fabric as per your application needs. 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. So you can define some parameter called as ‘ConnectionString’ in your definition file and set the value in the configuration file.

Step 5: Run your Application

In order to keep this simple, just run the project as it is. Your application will run as shown in the below browser and at the background fabric will create virtual instance in which your application runs. The below figure shows the virtual instance created by fabric to run your application.

Image Loading

In order to understand the power of Azure configuration, go to the service configuration file and change the instance to 2, you should see two instances of your web role running as shown below:

Image Loading
 
Sign Up to vote for this article
 
About Author
 
questpond
Occupation-
Company-
Member Type-Expert
Location-Not Provided
Joined date-24 Jun 2009
Home Page-
Blog Page-
 
 
Other popularSectionarticles
Comments
By:Kirti DarjiDate Of Posted:5/13/2010 12:38:23 AM
Good Keep It Up
Hi, Great this is very use full to know new technologies keep it Up
Leave a Reply
Title:
Display Name:
Email:
(not display in page for the security purphase)
Website:
Message:
Please refresh your screen using Ctrl+F5
If you can't read this number refresh your screen
Please input the anti-spam code that you can read in the image.
^ Scroll to Top