A step by step guidance to create First Windows Azure application

Posted by in Azure category on for Beginner level | Points: 250 | Views : 3643 red flag
Rating: 4 out of 5  
 1 vote(s)

This article will serve as a step by step guidance to create our First Windows Azure application


Quoting Wikipedia

Microsoft Azure is a cloud computing platform and infrastructure created by Microsoft for building, deploying, and managing applications and services through a global network of Microsoft-managed data centers.

It provides both PaaS and IaaS services and supports many different programming languages, tools and frameworks, including both Microsoft-specific and third-party software and systems.

Azure was announced in October 2008 and released on 1 February 2010 as Windows Azure, before being renamed to Microsoft Azure on 25 March 2014.

This article will serve as a step by step guidance to create our First Windows Azure application

Straight to experiment

Step 1: Install Azure SDK

Let us first download the latest Azure SDK

And install the Azure tools by using the Web Installer

Click on "Install"

Choose "I Accept" and the installation starts

It has installed 21 products

Once done, then click on the "Continue" button.

And it will display the products installed.

Clicking "Finish" will bring the next screen

From which we need to choose the below

Step 2: Choosing Project Template

Once the installation is ready, now let us open VS 2015 as an administrator. Select File -> New -> Cloud -> Azure Cloud Service.

Provide a ProjectName and a Location and click "OK"

Now we need to select our prefered language(C#) among the four languages to develop the application

Next we will be presented with many kinds of roles.

We will choose ASP.Net Web Role.

In simple words, Web roles are web applications hosted in IIS while Worker roles are processes that can do some background work like automatically compress uploaded images or send push notification if something changes in the database etc.

Next we will be presenetd with the below screen from which we will opt for "Web Forms" and set the Authentication mode to "No Authentication"

Click "OK". In the Solution Explorer we will find two projects - one is Windows Azure project (AzureCloudService1) and the other is an ASP.Net Web Role(WebRole1).

AzureCloudService1 project has three service configuration files viz ServiceConfiguration.Cloud.cscfg, ServiceConfiguration.Local.cscfg and ServiceDefinition.csdef.

ServiceConfiguration.Cloud.cscfg / ServiceConfiguration.Local.cscfg

This is configuration file for the cloud service. This contains setting for the roles and information about number of instance for the service

<?xml version="1.0" encoding="utf-8"?>
<ServiceConfiguration serviceName="AzureCloudService3" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="4" osVersion="*" schemaVersion="2015-04.2.6">
  <Role name="WebRole1">
    <Instances count="1" />
      <Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" />

ServiceConfiguration.Cloud.cscfg file

This service provides the configuration file for the cloud service and it contains settings for the roles. This file contains the information for the number of instances for the service. Whenever we want to increase the number of instances of the role this configuration is required for changing the instances.

ServiceConfiguration.Local.cscfg file

This service provides the configuration file for the local services. Whenever we want changes in the number of instances for the role in the local services, this file is required for changing the instance.


This is definition file for the cloud service. This file contains setting like bindings, settings etc.It also contains the information about the EndPoints and the default port number.

<?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition name="AzureCloudService3" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2015-04.2.6">
  <WebRole name="WebRole1" vmsize="Small">
      <Site name="Web">
          <Binding name="Endpoint1" endpointName="Endpoint1" />
      <Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" />
      <InputEndpoint name="Endpoint1" protocol="http" port="80" />

Step 3: Modifying Default.aspx and Default.aspx.cs

Let us now modify the Default.aspx as under

<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebRole1._Default" %>

<asp:Content ID="BodyContent" ContentPlaceHolderID="MainContent" runat="server">

    <div class="row">
        <div class="col-md-4">            
            <asp:Button ID="btnSayHello" Text="Say Hello" runat="server" OnClick="btnSayHello_Click" />
            <asp:Label runat="server" Width="100%" ID="lblMessage"></asp:Label>


And in the corresponding Default.aspx.cs, let us write the below

using System;
using System.Web.UI;

namespace WebRole1
    public partial class _Default : Page
        protected void Page_Load(object sender, EventArgs e)


        protected void btnSayHello_Click(object sender, EventArgs e)
            lblMessage.Text = "Hello to Windows Azure from RNA Team";

Step 4: Running the application locally

Press F5 and we will find that it is running in Azure Stogare Emulator

And the browser displays


Get started with Azure Cloud Services and ASP.NET


That's our first journey with Windows Azure.Hope this will be helpful. Thanks for reading.

Page copy protected against web site content infringement by Copyscape

About the Author

Full Name: Niladri Biswas (RNA Team)
Member Level: Platinum
Member Status: Member,Microsoft_MVP,MVP
Member Since: 3/17/2015 2:41:06 AM
Country: India
-- Thanks & Regards, RNA Team

Login to vote for this post.

Comments or Responses

Login to post response

Comment using Facebook(Author doesn't get notification)