Home > DeveloperSection > Articles > Create ASP.Net Web role in Windows Azure Application

Create ASP.Net Web role in Windows Azure Application


Cloud Computing Cloud Computing 
Ratings:
0 Comment(s)
 6405  View(s)
Rate this:

Create ASP.Net Web role in Windows Azure Application

In this article I am going to explain how to create ASP.Net Web role in Windows Azure Application.

Follow the steps given below to create or add ASP.Net web role in windows azure:

·         Open Microsoft Visual Studio 2010 as an administrator.

·         To create a new project FileNewProject.

·         Select Cloud template from the Installed Templates.

·         Select Windows Azure Project and enter the name of the project as MyWebRole.

·         Click OK to proceed.

Create ASP.Net Web role in Windows Azure Application

·         To add a web role to the solution, choose ASP.NET Web Role and then choose the right arrow. The roles are displayed in the Windows Azure solution pane of the dialog box.

·         Click OK.

Create ASP.Net Web role in Windows Azure Application

The Solution explorer view will look similar to given below. Delete the selected items from the WebRole1 application as shown below:

Create ASP.Net Web role in Windows Azure Application

After deleting the above items add a new Web Form (Default.aspx) in an ASP.Net application.
To add a new web form Right click on the solution explorerAddNew ItemSelect Web form – Enter Default.aspx in the Name TextBox.

Create ASP.Net Web role in Windows Azure Application

After add web form add web.config file in an asp.net application as show below:

Create ASP.Net Web role in Windows Azure Application

Add the following code in Default.aspx to see the output:

    <div>

        <h2>Welcome! This is my first Web Role Application</h2>

    </div>

 

After adding code Press F5 to in order to debug your application. The output looks like below:

Create ASP.Net Web role in Windows Azure Application

To manage your local deployments, open the shortcut menu for the Windows Azure icon in the notification area and then choose Show Compute Emulator UI.

The Windows Azure Compute Emulator is displayed.

Create ASP.Net Web role in Windows Azure Application

Choose WebRole1 to display the instances of the web role, as shown in the above illustration. Choose a specific instance to view individual instance.

After reading this article you can easily create web role in a Windows Azure Application.

 


Don't want to miss updates? Please click the below button!

Follow MindStick