Section 2: Create Windows Azure Web Role that Works with a SQL Azure Database
In this lab you will create a Windows Azure Web Role that will display information residing in a SQL Azure database. This application will eventually be surfaced in SharePoint using a SharePoint 2010 sandboxed Web Part.
In this lab, you will:
You must have the following items to complete this lab:
This Hands-On Lab is comprised of the following exercises:
Estimated Time to complete this lab: 60 minutes
Exercise 1: Create the Web Role
In this exercise, you will create a Web Role project and configure it to access the SQL Azure database created in a previous lab.
Task 1 – Creating The New Windows Azure Web Role Project
In this task, you will create the new Windows Azure web role project.
Exercise 2: Create Master Data List Page
In this exercise, you will create a page that will display the content of the database on a simple page using a GridView control.
Task 1 – Adding a GridView Control and DataSource to Display Contents of the SQL Azure Database
In this task, you will create the master detail page that will display all data from the SQL Azure database.
Task 2 – Updating the GridView Control Columns
In this task, you will modify the GridView to not display all details on each record in the database.
Exercise 3: Create Item Detail Page
In this exercise, you will create a new ASP.NET page that will be used to display the details of a selected item.
Task 1 – Creating the Details ASP.NET Page
In this task, you will create the page that will display the details of the item selected.
Task 2 – Adding a Data Source to the Detail Page
In this task, you will copy and modify the datasource used on the master list page.
Task 3 – Updating the Detail Page’s Data Source to Show the Selected Item
In this task, you will configure the data source to show the selected item.
Task 4 – Adding a Details View Control to View the Details of the Selected Item
In this task, you will add a details view control to the detail page to see the details of the item selected.
Exercise 4: Deploy Web Role to Windows Azure
In this exercise, you will package the Azure Web Role project into a deployment package, deploy it and ensure that it is working correctly.
Task 1 – Creating a Windows Azure Deployment Package
In this task, you will create a Windows Azure deployment package.
Task 2 – Depoloying the Windows Azure Web Role to Windows Azure
In this task, you will deploy the package created in the previous task to Windows Azure.
Windows Azure Web Roles allow developers to create complete web sites hosted in Windows Azure.These sites work like any other ASP.NET site and can connect to remote databases hosted in SQL Azure. This lab has shown how to easily creae a Web Role that displays the contents from a hosted SQL Azure database.