My First Windows Azure Application

In this simple application we will see how to create a windows Azure application from scratch:

Software needed:

Key points:

  1. You will see how the Windows Azure SDK and Visual Studio Tools for Windows Azure provide development tools that enable a rich and familiar development experience for cloud applications.
  2. You will see how Windows Azure abstracts you from the underlying infrastructure and uses simple models to define the roles and number of instances for your application.
  3. You will see how to deploy, start, and manage a Windows Azure application through the Management portal.

 

Action
1.    Start Visual Studio 2010 as Administrator user.
2. Select File -> New Project.
3. Select the Windows Azure Cloud Service template.
4. Select the Windows Azure Project type.
5. Name the solution HelloAzure.
6. Click OK to launch a wizard.

imageimage

7.    From the wizard, add the ASP.NET Web Role in C#.
8.    Select the added Role and click the edit icon.
9.    Rename from WebRole1 to HelloAzure_WebRole.
10.    Wait for the new solution to be created.
11.    Double click on the Default.aspx page to open it and select the design view.

image
12.    Expand the Toolbox.
13.    Drag and drop an ASP.NET Label Control.
14.    Change the Font->Size property for the new label to XX-Large

image

15.    Right click on the design surface and select View Code from the context menu to view the Default.aspx.cs code behind file.
16.    Add code in the Page_Load event to set the text for the label.

image
17.    Open the ServiceConfiguration.cscfg file.
18.    Updated the settings to run 2 instances of the web role.

image
19.    Select Debug->Start Debugging

image
20.    NOTE:   It will take 30-90 seconds until the Web application starts.

image

21.    Show the compute emulator by right-clicking on the Azure icon in the task bar and select “Show Compute Emulator UI”.
22.    Expand the HelloAzure application in the compute emulator and expand the HelloAzure_WebRole.
23.    Select the HelloAzure_WebRole and show the two instances that are running.

imageimage
24.    Switch back to Visual Studio.
25.    Set a breakpoint on the line that sets the label text.

image
26.    Switch back to Internet Explorer and refresh the page.
27.    Switch back to Visual Studio to see the breakpoint.
28.    Press F5 to continue execution.

image
29.    Stop the application by closing Internet Explorer.

30.    In the the next post we will see hot to deploy the windows azure service to the real cloud using the management portal. Sonrisa   Stay connected!