Basic Operations on Windows Azure Table in Windows Azure Storage in Storage Client Library 2.0

In this post we will take a look on performing basic operations on Windows Azure table using Windows Azure Storage Client Library 2.0.

To work with Windows Azure Storage Client 2.0 grab the library from NuGet package. Right click on the project and select Manage NuGet Packages. In NuGet Package Manager and type WindowsAzure.Storage to search. Click on the Install to add library in the project.

image

After adding references of Windows Azure Storage Client Library version 2.0, you need to add following namespace

image

We can create a table as like following. Create an instance of CloudStorageAccount. To create this instance you need to pass StorageCredentials object. Second parameter in creating CloudStorageAccount is bollean value true. It says to use https connection while working with Windows Azure Storage account.

image

After creating object of storage account, we need to create instance of CloudTabaleClient, We can create that as following,

image

Last step in creating Azure Table is to take a reference of CloudTable and create it if not exist. Studenttable is name of the table, we are intended to create here.

image

A Table can be deleted as following

image

Consolidating all the above discussion we can create a table with HTTPS connection using Windows Azure Storage Client Library 2.0 is as following,


using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Auth;
using Microsoft.WindowsAzure.Storage.Table;
using System;

namespace AzureTableStorage
{
 class Program
 {
 static void Main(string[] args)
 {
 CloudStorageAccount account = new CloudStorageAccount(new StorageCredentials("youraccountname", "youraccountkey"),true);
 CloudTableClient tableClient = account.CreateCloudTableClient();
 CloudTable table = tableClient.GetTableReference("Studenttable");
 table.CreateIfNotExists();
 }
 }

We are going to work with Studenttable. To represent entity of Studenttable let us create StudentEntity class as given in following code snippet. Make sure to inherit the class from TableEntity class.


public class StudentEntity : TableEntity
 {
 public StudentEntity()
 {
 PartitionKey= "Student";
 RowKey= Guid.NewGuid().ToString();
 }
 public double RollNumber { get; set; }
 public string Name { get; set; }
 public string Grade { get; set; }

}

We can insert an entity in table as following. Very first we need to create object of entity class or in other words need to create entity object to insert. We can create that as following,

image

Once entity to insert has been created next we need to create a TableOperationInsert. In the Insert function of TableOperation pass entity to be inserted. In this case studenttoInsert is the entity to be inserted hence passed as parameter. In last need to execute operation by passing it as input parameter of Execute function on instance of CloudTable.

image

Entity can be deleted by creating delete operation and executing it

image

In last let us consolidate all the discussions and full source code for working with Windows Azure table using Windows Azure Storage Client Library 2.0 is as following.

using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Auth;
using Microsoft.WindowsAzure.Storage.Table;
using System;

namespace AzureTableStorage
{
 class Program
 {
 static void Main(string[] args)
 {
 // Creating Storage Account
CloudStorageAccount account = new CloudStorageAccount(new StorageCredentials("youraccountname", "youraccountkey"),true);

//Creating Table Client
 CloudTableClient tableClient = account.CreateCloudTableClient();
 //Creating Table
 CloudTable table = tableClient.GetTableReference("Studenttable");
 table.CreateIfNotExists();
 //Creating Entity to insert
 var studenttoInsert = new StudentEntity
 {
 RollNumber = 1,
 Name = "Dhananjay Kumar",
 Grade = "Z"
 };

// Inserting an entity
 TableOperation operationToInsert = TableOperation.Insert(studenttoInsert);
 table.Execute(operationToInsert);
 Console.WriteLine("Student Entity Inserted ");
 Console.ReadKey(true);
 //Deleting an enitity
 TableOperation operationToDelete = TableOperation.Delete(studenttoInsert);
 table.Execute(operationToDelete);
 Console.WriteLine("Student Entity Deleted");
 Console.ReadKey(true);
 }
 }
}

I shall conclude this post by saying that we learnt how to perform basic operations on Windows Azure table using Windows Azure Storage Client Library 2.0. In further posts we will explore much more complex operations on Windows Azure table.

Error in installing Windows Azure Storage Client Library 2.0

To start working with Windows Azure Storage Client Library 2.0. I created a project and tried adding reference of Windows Azure Storage Client Library 2.0 using NuGet. When I tried installing, I got following error message.

“Microsoft.Data.OData could not be resolved”

image

This error message is clearly saying that you need to install Microsoft.Data.OData version greater than 5.0.2 to install Windows Azure Storage Client Library 2.0. To install this in NuGet Manager Package dialog search Microsoft.Data.OData and install it.

image

After installing this you should able to install Windows Azure Storage Client Library version 2.0 via NuGet. I hope you find this post useful. Thanks for reading.

Installing Windows Azure SDK on Visual Studio 2012

In this post we will do walkthrough of installing Windows Azure SDK on Visual Studio 2012. If Windows Azure SDK is not installed on your machine then on launching of Visual Studio 2012 and selecting Cloud project template, you will get option of Get Windows Azure SDK for .NET. Click on that.

You will get an option to Download Windows Azure SDK for .NET


Next you will be navigated to Windows Azure download page , Click on install the SDK


Choose Visual Studio 2012 to start installation


You will be prompted with confirmation box. Choose to run in the confirmation box 


You need to now click on Install button to start installing. 


Make sure all the prerequisite is installed and Accept Term and conditions. 


Windows Azure SDK will get start installing. After successful installation on launching of Visual Studio 2012 and selecting Cloud project tab, you will get Windows Azure Cloud Service project template to start working with Windows Azure projects. 


In this way you can install Windows Azure SDK on Visual Studio 2012. I hope you find this post useful. Thanks for reading it.

Configure Node.js for Windows

In this post we will walkthrough step by step to set up environment for node.js on windows. Very first navigate to Windows Azure Download page and select node.js for Windows to download

image

Once you click on node.js download option for Windows you will get following confirmation windows. Click on Save File.

image

After saving the file when you run the exe, it would launch a Web Platform Installer. You will get option to install Windows Azure SDK for Node.js. Click on Install button to proceed with installation

image

After successful installation you will get information about successful installed products as following in a dialog box.

image

After installation open command prompt as administrator and run the command

npm install azure-g

image

After successful installation of package create a working folder. For example I have created a folder called nodedemo in C drive. Now navigate to http://nodejs.org/ and copy the Hello Word sample from here

image

Create a file called server.js inside nodedemo folder and paste this code. After this run the command

node server.js

image

You will get message that node server is running. Now when you navigate to http:127.0.0.1:1337 , you should be getting following response from the server

image

Once you get this response you can be sure that node server is configured on windows. I hope you find this post useful. Thanks for reading.

 

Step by Step creating Virtual Machine in Windows Azure

In this post we will walkthrough step by step to create Virtual Machine in Windows Azure. To start with very first you need to login to Windows Azure Management Portal here and then click on Virtual Machines option in left panel.

image

If you do not have any virtual machine created then you will get following message. You need to click on CREATE A VIRTUAL MACHINE

image

If you do not have any virtual machine created then you will get following message. You need to click on CREATE A VIRTUAL MACHINE. After clicking that you will get following option

  1. QUICK CREATE
  2. FROM GALLERY

In this tutorial let us try option of Quick Create. On selecting this option

First you need to provide DNS NAME of the virtual machine. It should be unique. You will get a right mark on valid DNS name.

 

image

Next you need to choose the Image for the Virtual Machine. Choose any image as of your requirement. You will get virtual machine mount with image you will choose from the dropdown.

image

Next you need to provide password to access Virtual Machine. Choose the size of the machine and datacenter. After providing these entire information clicks on Create Virtual Machine to create the virtual machine.

image

In bottom of the page you can see information and status on creating virtual machine.

image

Once Virtual Machine got created successfully, you can see the details as following

 

image

 

In this way you can create Virtual Machine in Windows Azure. I hope you find this post useful. Thanks for reading.

 

AdventureWorks database for SQL Azure

 

In this post we will walkthrough step by step to create AdventureWorks database for SQL Azure. We will use AdventureWorks database for SQL Azure from codeplex. To create follow the step as below,

Step 1

Go to http://msftdbprodsamples.codeplex.com/

Step 2

Download SQL Azure OLTP from the codeplex site

image

Step 3

After downloading unzip the file in a folder. After unzipping file open command prompt and change directory to unzipped folder. I have unzipped the file in folder names SQLAzurePortal.

image

Step 4

Cross check that your machine IP address is in range of the firewall rules.

image

Step 5

Run the command as following

image

In case you wonder what is yours SQL Azure Server name, you can check that as following. Log in to SQL Azure portal and right panel you can get information about username and server name

image

Your command should be as following

image

After successful installation with data in SQL Azure, you should get following successful message.

image

Now to verify that whether AdventureWorks database got installed successfully, open SQL Azure portal and in database you should able to see that database has been listed there

image

In this way you have successfully installed AdventureWorks database on SQL Azure. I hope this post was useful. Thanks for reading

 

Create Windows Azure Website in 6 Steps

In this post we will create a Windows Azure Website in 6 simple steps. Windows Azure Website is a new feature of Windows Azure and got introduced on 7th June.

Step 1

Very first you need to Login to Windows Azure Management Portal. After successful login from the left panel, click on WEB SITES.

clip_image001

Step 2

Next click on CREATE A WEBSITE

clip_image003

Step 3

You can create a WebSite in three ways

  1. Quick Create
  2. Create with DataBase
  3. From Gallery

In this post we are creating Site using Quick Create WebSite option.

clip_image005

We have provided URL and selected the region to host the website.

clip_image007

Step 4

After successfully creating website click on Name of the website.

clip_image009

On clicking DASHBOARD will be open. On Dashboard you can see all the details about the website. From quick glance section select option of Download publish profile.

clip_image011

Make sure in the Configure tab .Net Framework version is selected to V4.0

clip_image013

Step 5

Open Visual Studio and create a new ASP.Net MVC 4.0 Application.

clip_image015

Choose project template as Internet Application.

clip_image017

Step 6

You can edit website per your requirement. In this post our purpose is to learn publishing the ASP.NET MVC Internet Application in Windows Azure website. For that right click on the project and choose publish

clip_image018

Next we need to import publish file. Click on import button and choose file we downloaded previously in step 4.

clip_image020

Select publish file to import.

clip_image021

You will notice all the settings have been imported. Click on Publish to publish ASP.Net MVC Application to Windows Azure website.

clip_image023

After successful publish operation Windows Azure website will be open in default browser.

First look of New Windows Azure Portal

I must say, I liked this new HTML5 based Windows Azure Portal. Once you login in Windows Azure Portal at the bottom you can find View the Preview Portal

image

You will be prompted to take a tour of new portal.

image

You will be getting dashboard as following,

image

You can see details of all the Hosted Service and Storage Account and SQL Azure database there. Details like

  • Type
  • Status
  • Subscription
  • Location

Is shown on the home page as following

image

There are four tabs in left side. By default All Items tab is selected. Other tabs are as following

image

If you want to get more details about Hosted Service then select Cloud Services tab and you will be getting much deeper details as following

image

In same way if you want finer lever details on SQL Azure database then select SQL DATABASES tab from left . You will be getting SQL Azure database details as following

image

If you want finer level details on Storage you can get by selecting Storage tab. You will be getting details as following

image

You can create following items by clicking new button in bottom

image

Items can be created as following

  • New Hosted Service
  • New Storage
  • New SQL Database
  • New Web Site
  • New Virtual Machine
  • New Network

image

There are some features might be disabled in your subscription. You will get following message when you select that feature. In my subscription Web Site, Virtual Machine and Network is not available and I get below message when I select them. Any time we can sign up for Preview Program.

image

While creating you will be having two options of QUICK CREATE or CUSTOM CREATE. Quick Create will create a cloud service by just specifying URL. Content deployment and configuration can be done later.

image

Custom Create will create cloud service by providing URL and optionally providing content employment and configuration.

image

You can manage keys and delete a service from the option given in bottom of the page.

clip_image001

In bottom you have option to get Help as well.

clip_image003

On clicking of HELP you will be getting various details and various operations.

clip_image005

In further blog post I will give more details of other features. Till then enjoy the new Azure Portal.

 

How to create WCF REST Service and host in Windows Azure

In this post, we will create a WCF REST Service and host in Windows Azure. We will learn following things in this post

  • Working with WCF Web Role
  • Enabling REST on WCF Web Role
  • Returning XML and JSON from REST service
  • Deploying WCF Service Web Role to Windows Azure

We need to host WCF Service in Windows Azure. So create project choosing WCF Service Web Role from Cloud tab.

image

We are going to return list of Players from the Service as XML and JSON. For that add a class to project called Players and attribute it as DataContract. Below I am creating Players class and attributing the class as DataContract and all the properties as DataMember.


[DataContract]
public class Players
{
[DataMember]
public string Name { get; set; }
[DataMember]
public string Sports { get; set; }
[DataMember]
public string Country { get; set; }
[DataMember]
public string ImageUrl { get; set; }

}

After creating DataContract, we need to create ServiceContract. I am creating ServiceContract with two OperationContracts. One OperationContract is retuning XML whereas another is returning JSON. ServiceContract is given below,

IService1.cs


[ServiceContract]
public interface IService1
{

[WebGet(UriTemplate="/GetPlayersXml",
RequestFormat=WebMessageFormat.Xml,
ResponseFormat=WebMessageFormat.Xml,
BodyStyle= WebMessageBodyStyle.Bare)]
List<Players> GetPlayersXml();

[WebGet(UriTemplate = "/GetPlayersJson",
RequestFormat = WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json,
BodyStyle = WebMessageBodyStyle.Bare)]
List<Players> GetPlayersJson();

}

  • There are two operation contracts.
  • GetPlayersXml function will be returning XML as response.
  • GetPlayersJson function will be rturning JSON as response.
  • Using WebGet attribute REST behavior has been enabled on the Operation Contracts.
  • We can get Players as XML at Uri baseaddress/Service1.svc/GetPlayersXml and as JSON at Uri baseaddress/Service1.svc/GetPlayersJson

We have created DataContract and defined the ServiceContract. Next we need to implement service. In implementing I am returning hardcoded data however you can return data from SQL Azure or Azure Storage as well. Service is implemented as below,

Service1.svc.cs


public class Service1 : IService1
{
public List<Players> GetPlayersXml()
{
return GetPlayers();
}

public List<Players> GetPlayersJson()
{
return GetPlayers();

}

private List<Players> GetPlayers()
{
List<Players> Players = new List<Players>
{
new Players
{
Country ="India", Name="Sachin Tendulkar",Sports ="Cricket", ImageUrl="sachin.jpg"
},
new Players
{
Country ="India", Name="MS Dhoni",Sports ="Cricket", ImageUrl="dhoni.jpg"
},
new Players
{
Country ="Australia", Name="Rickey Ponting",Sports ="Cricket", ImageUrl="rickey.jpg"
},
new Players
{
Country ="India", Name="Sandeep Singh",Sports ="Hockey", ImageUrl="sandeep.jpg"
},

};
return Players;
}
}

In service implementation I have created a function named GetPlayers(). This function is returning List of Players and calling same function in both function GetPlayerXml and GetPlayerJson.

Last step we need to perform is to enable REST EndPoint on the service. For that we need to configure EndPoint behavior as below,

image

And then we need to create EndPoint with WebHttpBinding to enable REST on WCF Service. EndPoint will be as below,

image

In contract PlayerData is namespace and IService1 is ServiceContract we created in previous step. Finally configuration will be as below,


<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="servicebehavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="restbehavior">
<webHttp/>
</behavior>
</endpointBehaviors>
</behaviors>
<services>
<service name ="PlayerData.Service1" behaviorConfiguration ="servicebehavior" >
<endpoint name ="RESTEndPoint"
contract ="PlayerData.IService1"
binding ="webHttpBinding"
address =""
behaviorConfiguration ="restbehavior"/>
</service>
</services>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>

This is what all we need to do to create a WCF REST Service to be hosted on Windows Azure. Press F5 to run and test WCF Service Web Role in local development fabric. Make sure that you have set Windows Azure project as startup project.

On running you can see output in browser as below. I am calling GetPlayerXml function

image

You can see that Players data as XML is accessible at baseaddress/Service1.svc/GetPlayersXml. Since currently we are running WCF Service Web Role in local azure emulator so base address is IP address of localhost at port 81.

Next after testing locally you can deploy service at Windows Azure. For that right click at Windows Azure project and select Package. Next choose Service Configuration as Cloud and Build Configuration as Release and click Package.

image

After successful package you can see Service Package File and Cloud Service Configuration file in the folder explorer. We need to upload these two files to deploy application on Microsoft Data Center. And later upload this package in Windows Azure Hosted service to host created WCF Service Web Role in Windows Azure.

In another way to publish see this post wriiten by me to publish from Visual Studio

In this way you can create a WCF REST Service and host in Windows Azure. I hope this post is useful. Thanks for reading.

Step by Step Guide to Create First Windows Azure Application

Target audience: Beginners in Windows Azure or Level 100

One can argue that why this step by step guide after so many years of Windows Azure? and why I wrote this article after my more than 80 articles on Azure?

image

Answer is, when I started writing this article, my objective was very much clear in my mind. I wanted to help people starting with Windows Azure from installation of SDK to Deployment to Microsoft Data Center. In this article I am targeting people who want to start learning and developing for Windows Azure.

Article is divided into five parts

  1. Installation of Windows Azure SDK
  2. Developing First Windows Azure Web Application
  3. Deploying application locally in Development Storage Fabric
  4. Registration for free Windows Azure Trial
  5. Deployment of the Application in Microsoft Data Center

I will start fresh with installation of Windows Azure SDK and I will conclude this post with deployment of simple application in Windows Azure Hosted Service. I am not going to create a complex application since purpose of this post is to walkthrough with all the steps from installation, development, debugging to deployment. In further post we will get into more complex applications. Proceed through rest of the post to create your first application for Windows Azure.

Installation of Windows Azure SDK

Step 1

Go to official site of Windows Azure at link http://www.windowsazure.com/en-us/

Step 2

In bottom of page, you will get Develop option. Click on Show Me More.

clip_image001

Step 3

Now you need to choose the language you want to work with. You can develop application in any of the language given in option and deploy it on the Microsoft managed datacenters. Below are the available languages.

clip_image002

To start developing using .NET, click on .NET.

Step 4

You will be navigated to Home Page of .NET Developer Center. You will get all the resources related to .NET development on Windows Azure here. Now click on Install to install Windows Azure SDK. I am assuming here that you are already having VS2010 on your machine.

clip_image003

Windows Azure SDK and tools are available to install via Web Installer. Click on the Install in the dialog window.

clip_image005

Next dialog windows will prompt you to agreement. Select I Accept option to proceed.

clip_image007

You will be getting dialog window indicating Windows Azure SDK being installed.

clip_image009

After successful installation you will get confirmation dialog windows as below.

clip_image011

Now click on Finish and Exit.

Congratulation by now you has installed Windows Azure SDK on your machine.

 

Developing First Application

Open Visual Studio 2010 as administrator and create a new project. Open File -> New->Project. From Cloud tab select Windows Azure Project.

image

Next you need to click on your preferred language. You can use any of the three languages to develop application to be deployed on Windows Azure. I am choosing language Visual C#. After clicking on the language you will get options to select as either Web Role or Worker Role.

clip_image001[6]

Before we proceed further, let us stop by and try to understand what are the Web Role are Worker Role?

Web Role takes HTTP input and Process it. It gives output as HTTP Response. It takes input from user via a user interface.

clip_image002[6]

Web Role can be summarized as below,

clip_image004

You create any application as Web Role instance. For example,

  • If you want to create a Web Application using ASP.Net then you will be choosing an ASP.Net Web Role in the project template
  • If you want to create a WCF Service and deploy it on Azure then you will be choosing WCF Service Web Role.
  • If you want to create ASP.Net MVC application then you will be choosing ASP.Net MVC Web Role.

Worker Role runs in the background. It is used to perform some background task. It does not take input from user. It takes input from Azure Storage or web Role.

Worker Role can be summarized as below,

image

Let us get back to creating first web application to be deployed on Windows Azure. Go ahead and select ASP.NET Web Role and click on arrow button. If you want you can change name of the Web Role. Since this is your first application so for the simplicity leave default name. After selecting Web Role click on Ok.

image

On exploring solution explorer you will find that there are two projects. One project is Widows Azure Project and other is ASP.Net Web Role.

image

Let us explore Windows Azure Project. Project got two Service Configuration files. Extension of Service Configuration file is cscfg

image

One Service configuration file is for local deployment and one contains configuration details to deploy to Microsoft Data Center. On opening service configuration file, you will get below XML.

image

Below information’s are provided in service configuration file.

  • Operating system version
  • Operating system family
  • Connection string settings
  • Instance counts

By default instance count is set to 1. It means there will be one instance of Web Role will be running for the deployment. Let us go ahead and increase instance count to 2. Change value to 2 in Instance count entry as below and save the file.

image

Next important file is Service Definition file. Extension of Service Definition file is csdef

image

On Opening service definition file you will get below XML

image

Service definition file contains information about binding and different sites. It contains information about EndPoints and default port number. In normal scenario, you may not need to edit this file.

Next important file is WebRole1. If you remember we did not change name of the Web Role while creating it in previous step.

image

When you click on WebRole1, you will get below UI.

image

In this UI you can,

  • Manage Settings
  • Configure Web Role
  • Configure local storage
  • Manage settings
  • Configure End Points
  • Manage virtual networks

In later post we will go into details of each of the section of this UI. As of now we can proceed with default values.

Now we have a bit understating on different files in Windows Azure project in the solution. Other project is normal ASP.NET Web Application project with one extra file called WebRole.cs. This file is used to host web application in Windows Azure.

image

Let us open default.aspx and modify it as below, I have deleted all the default codes from MainContent and put one H1 tag as below.

image

By this, we have created a simple ASP.Net Web Role Application to be deployed on Windows Azure.

 

Deploying Application Locally

You deploy application in two steps. First you deploy it locally to do testing that if everything is working as expected. You can debug application deployed on local development fabric. A Windows Azure emulator run locally is also known as Windows Azure Development Fabric.

To run Windows Azure Web Role application locally makes sure that Windows azure project is set as startup project and press F5. To make Windows azure project as startup project right click on that and select set up as startup project

image

After setting startup project press F5 to run application on local development fabric. After pressing F5 you can see that in bottom you are getting messages like initializing the Windows Azure storage emulator etc.

image

On successful deployment you should be getting Ready message at bottom

image

After successful deployment browser will get launched and you can see your Windows Azure Application running on local development fabric.

image

You can see application is running on port 81 and default start page is default.aspx. Let us explore local development fabric. To open local development fabric from the task bar right clicks on Windows Azure icon.

image

Right click on the Windows Azure icon and select Show Compute Emulator UI. You will get Windows Azure Compute Emulator UI. In emulator you can see health of the Web Role instances. There are two instances running since we configured two instance of Web Role in service configuration file.

image

On right clicking on the Web Role instance you can set logging level and can open local store.

image

In further post we will get into details of logging and health of Web Role instances. As of now we have seen the way to create Windows Azure Web Role Application and deploy it locally. Now let is deploy created application in Microsoft Data Center or on real cloud.

 

Deploying Application On Windows Azure Portal

To deploy application on Microsoft Data Center you need to have a Windows Azure Account. Windows Azure is a paid service however you can start with free trial. To register for free account follow the below steps.

Register for Free Account

Step 1

Go to official site of Windows Azure at link http://www.windowsazure.com/en-us/

Step 2

In right hand side click on free trail

clip_image001[8]

Step3

Next click on Try it free.

clip_image003

Step 4

You will be asked to login using Live ID. Provide your live id and login. If you don’t have live ID create one to work with Windows Azure Free Trail

clip_image005[6]

Next proceed through the screen to create free account.

clip_image007[6]

After successful registration you will be getting a success registration message. After registration go back to visual studio and right click on Windows Azure Project and select Package.

image

Next choose Service Configuration as Cloud and Build Configuration as Release and click Package.

clip_image001[10]

After successful package you can see Service Package File and Cloud Service Configuration file in the folder explorer. We need to upload these two files to deploy application on Microsoft Data Center.

clip_image003[6]

After successful registration for free account again browse to https://www.windowsazure.com/ and click on Management Portal from Account section in bottom.

clip_image004

You will be navigated to live login page. Provide same live id and password you used to create Free Trial. After successful authenticating you will be navigated to Management Portal.

To deploy on Microsoft Data Center, first you need to create Hosted Service. To create Hosted Service from left tab select Hosted Service, Storage, Account and CDN

clip_image005

In top you will get three options. Their purpose is very much clear with their name.

clip_image006

Click on New Hosted Service to create a Hosted service. Provide information as below to create hosted service.

clip_image007

Choose Subscription Name. It should be the same as your registered subscription of previous step.

  • Enter name of the service
  • Enter URL of the service. This URL need to be unique. On this URL you will be accessing the application. So this application will be used at URL debugmodemyfirstservice.cloudapp.net
  • Choose a region from the drop down. In further post we will get into details of affinity group.
  • In Deployment option choose, Deploy to production environment.
  • Give a deployment name.

Next to upload package select browse locally. On browsing navigate to folder YourFolderName\MyFirstWindowsAzureApplication\MyFirstWindowsAzureApplication\bin\Release\app.publish and choose files.

image

As of now for simplicity don’t add any Certificate and click on Ok to create a hosted service with package of application created in last step. You will get a warning message. Click Yes on warning and proceed.

image

Now you need to wait for 5 to 10 minutes to get your application ready to use. Once service is ready you can see ready status for the Web Role.

image

After stats are ready, you are successfully created and deployed first web application in Windows Azure. Browse to URL http://debugmodemyfirstservice.cloudapp.net/ to see your application running from Microsoft Data Center.

image

In this way you can start developing for Windows Azure. In further post we will go into many details. I hope this post is useful. Thanks for reading.