Click here to Skip to main content
Click here to Skip to main content

Tagged as

5 Simple Steps to Run your First Azure Program

, 26 Feb 2014 CPOL
Rate this:
Please Sign up or sign in to vote.
5 simple steps to run your first Azure program

Table of Contents

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 600+ videos on various topics like Design Patterns, WCF, WWF, WPF, LINQ, SilverLight, UML, SharePoint, Azure, VSTS and lots more @ click here , you can also catch me on my trainings @ click here.

o 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.

My Other Azure FAQ Articles

  1. Azure FAQ Part 1
  2. Simple 5 steps to run your first Azure program
  3. 7 simple steps to run your first Azure Queue program
  4. 9 simple steps to run your first Azure Table Program
  5. Simple 6 Steps to Run your First Azure Worker Role Program

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.

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

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

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:

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’.

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.

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.

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:

License

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

Share

About the Author

Shivprasad koirala
Architect http://www.questpond.com
India India

I am a Microsoft MVP for ASP/ASP.NET and currently a CEO of a small
E-learning company in India. We are very much active in making training videos ,
writing books and corporate trainings. Do visit my site for 
.NET, C# , design pattern , WCF , Silverlight
, LINQ , ASP.NET , ADO.NET , Sharepoint , UML , SQL Server  training 
and Interview questions and answers


Comments and Discussions

 
GeneralMy vote of 5 PinmemberMahsa Hassankashi29-Oct-14 14:22 
QuestionWhat about windows 8 / 8.1? Pinmember_Noctis_26-Feb-14 3:05 
AnswerRe: What about windows 8 / 8.1? PinmvpShivprasad koirala26-Feb-14 5:01 
QuestionHow to stop instance of Web Role? PinmemberKaustbh8-Feb-10 18:45 
GeneralThanks PinmemberJigneshSE31-Dec-09 18:22 

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

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

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.141216.1 | Last Updated 26 Feb 2014
Article Copyright 2009 by Shivprasad koirala
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid