---
title: "Create ASP.Net Web role in Windows Azure Application"  
description: "In this article I am going to explain how to create ASP.Net Web role in Windows Azure Application."  
author: "Chris Anderson"  
published: 2012-01-23  
updated: 2019-09-07  
canonical: https://www.mindstick.com/articles/862/create-asp-dot-net-web-role-in-windows-azure-application  
category: "cloud computing"  
tags: ["cloud computing"]  
reading_time: 2 minutes  

---

# 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](https://yourviews.mindstick.com/view/81711/microsoft-disconnects-cortana-and-reinvents-it) [Visual Studio](https://www.mindstick.com/articles/12378/visual-studio-for-mac-is-out-of-beta-preview-now-officially-available) 2010 as an administrator.

· To create a new project **File** – **New** – **Project**.

· Select **Cloud** template from the **Installed [Templates](https://www.mindstick.com/interview/34049/what-are-templates-in-knockout-js)**.

· 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](https://www.mindstick.com/mindstickarticle/3a635747-dd48-4908-88e7-138864290196/images/02c35ee4-7baf-4d48-8b24-423cb3d9b4c1.png)

· 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](https://www.mindstick.com/mindstickarticle/3a635747-dd48-4908-88e7-138864290196/images/b5b62845-df8d-40f6-85d4-3214b020ea94.png)

The Solution explorer view will look similar to given below. Delete the [selected items](https://www.mindstick.com/forum/352/i-need-to-display-my-checkboxlist-selected-items-in-a-label-how-to-do) from the WebRole1 [application as](https://answers.mindstick.com/qa/41069/how-did-missouri-s-application-as-a-slave-state-in-1819-challenge-u-s-law) shown below:

![Create ASP.Net Web role in Windows Azure Application](https://www.mindstick.com/mindstickarticle/3a635747-dd48-4908-88e7-138864290196/images/95a9a295-0868-429e-bbb4-4b30f18a22d2.png)

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 explorer** – **Add** – **New Item** – **Select Web form** – Enter **Default.aspx** in the Name TextBox.

![Create ASP.Net Web role in Windows Azure Application](https://www.mindstick.com/mindstickarticle/3a635747-dd48-4908-88e7-138864290196/images/8246beb7-83c1-40be-8251-49321b2fefdf.png)

After add web form add **[web.config](https://www.mindstick.com/forum/183/web-config-file)** file in an [asp.net application](https://www.mindstick.com/forum/540/using-stored-procedures-with-entity-framework-in-an-asp-dot-net-application) as show below:

![Create ASP.Net Web role in Windows Azure Application](https://www.mindstick.com/mindstickarticle/3a635747-dd48-4908-88e7-138864290196/images/4541398f-0fd6-4ee5-97d9-ba55ddfb6388.png)

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](https://www.mindstick.com/mindstickarticle/3a635747-dd48-4908-88e7-138864290196/images/7a133c72-eb20-4288-8b4a-ecfe14cd27a0.png)

To [manage your](https://www.mindstick.com/articles/12870/10-easy-ways-to-manage-your-business-email-inbox) local deployments, open the shortcut menu for the Windows Azure icon in the [notification](https://www.mindstick.com/blog/205/property-notification-in-c-sharp) area and then choose **Show Compute Emulator UI**.

The **Windows Azure Compute Emulator** is displayed.

![Create ASP.Net Web role in Windows Azure Application](https://www.mindstick.com/mindstickarticle/3a635747-dd48-4908-88e7-138864290196/images/882bd568-e894-4aba-94c1-3504fc08b0fe.png)

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.

---

Original Source: https://www.mindstick.com/articles/862/create-asp-dot-net-web-role-in-windows-azure-application

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
