Getting Started with Windows Azure

Before you we can play around with Azure we need to install a few things.  Note: These instructions work for Visual Studio 2010 RC on Windows 7.

Download and install Windows Azure platform AppFabric SDK V1.0

http://www.microsoft.com/downloads/details.aspx?FamilyID=39856a03-1490-4283-908f-c8bf0bfad8a5&displaylang=en

Setup IIS for ASP.Net

To enable IIS 7.0 with ASP.NET on Windows 7

1.     Click the Start button, click Settings, click Control Panel, click Programs, and then click Programs and Features.

2.     Click Turn Windows Features On or Off.

3.     Under Internet Information Services, expand World Wide Web Services.

4.     Under Application Development Features, click ASP.NET.

5.     Under Common HTTP Features, click Static Content.

6.     Install the selected features.

http://msdn.microsoft.com/en-us/library/dd179419.aspx

If you don't have SQL Express installed:

open the Windows Azure SDK Command Prompt:

And enter the following text:

dsinit /sqlinstance:.

The ?dot? represents the default SQL Server instance and may optionally be replaced with any valid instance name.

Next lets open visual studio as administrator.  Select File -  New ? Project.  Select the cloud template and give the project a meaningful name like?MyFirstCloudService?.

Select Ok.

Next we need to select a role:

image

Let?s keep it simple and select an ASP.Net Web Role (we are indicating that we will be hosting a web site in the cloud).

image

Click the ?(pencil) icon to rename the Role to something meaningful ? ?MyFirstWebSiteRole? will do.

Select OK

Notice we have 2 projects

image

The MyFirstCloudService project contains all of our configuration information such as the size of our VM, the endpoint configurations, configuration settings and local storage.  The second project, MyFirstWebRole, contains the asp.Net web site with a couple additions, 1) We have a file named WebRole.cs which is used to recycle the role instance if a configuration change is made and 2) notice we have several references to Microsoft.WindowsAzure.* which gives us access to the Azure APIs.

Before we run let?s add a multi-line textbox to the aspx page name Textbox1 and add the following code to the corresponding Page_Load event

 

Code Snippet
  1. protected void Page_Load(object sender, EventArgs e)
  2. {
  3. ????TextBox1.Text += "Running In Azure: " + RoleEnvironment.IsAvailable.ToString() + "\n";
  4. ????TextBox1.Text += "Deployment Id: " + RoleEnvironment.DeploymentId + "\n";
  5. ????TextBox1.Text += "Role Instance Id: " + RoleEnvironment.CurrentRoleInstance.Id + "\n";
  6. }

 

Press F5 and we will see our page with an output similar to this:

image

Notice when you started the app a little blue icon showed up in your systray.

 

image

This is the dev app fabric ? we are not actually running in the cloud yet!

 

Right click on the icon and select Show Development Fabric UI.

image

If we highlight some the various nodes on the left, we see how things in the Development Fabric line up with things on our ASPX page.

So what is a role?

A role is just another name for your app.  It specifically refers to the base virtual machine image that hosts your app.  In our case, a web role, we are talking about a VM that hosts your application within IIS.

What is the development fabric?

The development fabric simulates the Windows Azure fabric on your local computer so that you can run and test your service locally before deploying it.  That is a lot of information for one post, we will go over the fabric, configuration, and actually deploying the service in another post (that will require an azure account and a credit card.


Posted by: Tim Star
Posted on: 3/22/2010 at 9:09 PM
Tags: ,
Categories: Cloud Computing | .NET
Actions: E-mail | Kick it! | DZone it! | del.icio.us
Post Information: Permalink | Comments (0) | Subscribe to this BlogRSS comment feed

Add comment




biuquote
  • Comment
  • Preview
Loading


Contact Us 651-994-8558 1-800-866-9884
Home | Training | Curriculum | Course Finder | Schedule | Enroll | Twin Cities Java User Group | Consulting | Foundation | Jobs | About Us | Our Story | Press Room | Instructors | President | Map & Directions | Sitemap

Java Training | JSF / Struts / Spring / Hibernate Training | Java Power Tools Training | .NET 4.0 & Visual Studio 2010 Training | .NET 3.5 and Visual Studio 2008 Training | .NET 2.0 and Visual Studio 2003 Training | Prism / MVVM / MEF Training | Microsoft Web Development Training | Cloud Computing Training | Ajax / Web Services / XML Training | Groovy and Grails Training | SQL Server 2008 Training | SQL Server 2005 Training | Mobile Development Training | SharePoint 2010 Training | SharePoint 2007 Training | Agile, Process, Analysis & Design Training | Arch/Design Patterns Training | Microsoft Official Curriculum Training | Web Development Training | Ruby Training | Rational Application Developer (RAD) Training | WebSphere Application Server Training | WebSphere Portal Training | WebLogic Training | Boot Camp Training | Project Management Training | C++ Training | Metro / WinRT / Windows 8 Development Training | Retired

Intertech delivers training on-site and virtually serving cities including Phoenix, AZ | San Francisco, CA | Los Angeles, CA | San Diego, CA | San Jose, CA | Washington, DC | Chicago, IL | Orlando, FL | Boston, MA | Duluth, MN | Minneapolis St. Paul, MN | Rochester, MN | Raleigh-Durham, NC | New York, NY | Philadelphia, PA | Austin, TX | Dallas, TX | Houston, TX | Seattle, WA.