次の方法で共有


Bruno’s Tour of the Windows Azure Platform Training Kit–Web Roles, Worker Roles, Tables, Blobs, and Queues

  Introduction
  My goal in this series is to highlight the best parts of the hands-on labs. I constantly give presentations to software developers about cloud computing, specifically about the Windows Azure Platform. As the founder of The San Francisco Bay Area Azure Developers Group (https://www.meetup.com/bayazure/), I am always asked for the best place to start.

  Luckily there is one easy answer - The Windows Azure Platform Training Kit.
  As of this writing, this is the latest version.
hyperlink2  

Download the Windows Azure Platform Training Kit


Hands-On Labs or Demos

 

I will focus on Hands-On Labs, not the demos, atleast initially. But don't discount the value of the demos because they are easier and shorter. I will point out some of the useful demos as I progress through this post.

0on5zlur


  Lab #1 - Introduction to Windows Azure
 

This is perhaps the best of all the hands-on labs in the kit. But it certainly is not the easiest. image


  Technical Value
 

As you may be aware, the sweet spot for making use of Windows Azure is that it is "Platform as a Service (PaaS)," as opposed to "Infrastructure as a Service."

This post describes the difference:

hyperlink2  

Differences between IaaS, PaaS, SaaS

My take is that the future is PaaS because it frees you from worrying about the underlying servers, load balancers, and networking. It is also the most economical. At the end of the day is about the ratio of servers to underlying support staff. PaaS is far more self-sustaining and autonomous that IaaS.

The Big Picture

Now because Windows Azure is PaaS, Lab #1 is ideal. It gives you the "big picture," a clear understanding of how web roles, worker roles, tables, blobs, and queues work together to form a whole PaaS application.


  What Lab #1 illustrates
  Most of Azure’s core technologies are explained in this excellent lab.
Azure Component Purpose
Web Role Allows users to upload photos.
Worker Roles Used to make thumbnails out of uploaded photos. Writes metadata about generated thumbnail to table object.
Queues Used to pass work from web role to worker roles in a loosely coupled way, paving the way for an asynchronous architecture.
Tables - NOT SQL Azure Relational Tables Used to store metadata about the images that have been uploaded. Tables allow for highly scalable data and millions of rows of data, automatically distributing records across multiple storage nodes.
Blobs Used to store the images themselves, both the originally uploaded photo, as well as the thumbnail that was generated by the Worker Role.
   
  Useful Code Snippets
  I was such a big fan of this lab, I completely rewrote it so that I could fully grasp it. It looks like this: MyImage I wanted to give the lab a little more polish. Working with Tables The Windows Azure Table service can be used to efficiently store millions of entities (rows in relational parlance). To be able to “talk” to your table objects you’ll need to inherit from TableServiceContext and provide the following boilerplate code.

public class GuestBookDataContext

    : Microsoft.WindowsAzure.StorageClient.TableServiceContext

{

    public GuestBookDataContext(string baseAddress, Microsoft.WindowsAzure.StorageCredentials credentials)

        : base(baseAddress, credentials)

    { }

 

    public IQueryable<GuestBookEntry> GuestBookEntry

    {

        get

        {

            return this.CreateQuery<GuestBookEntry>("GuestBookEntry");

        }

}

 

 

** Note that the table object to which we’ll add entities (rows in relational parlance) is called GuestBookEntry.

Caveat for the lab – Creating the table for the first time

The lab does have some room for improvement. The application attempts to create the table every time it runs. Obviously this won’t work if the table already exists. To solve this problem, I recommend looking at Steve’s post here:

hyperlink2  

Read about correctly Creating Azure Table Objects


  For Beginners – The Demos
  A more gentle introduction to the platform is found here in “Demos.”
Lab Title Description
Hello Windows Azure This document provides setup documentation, step-by-step instructions, and a written script for showing a demo of Windows Azure. This document can also serve as a tutorial or walkthrough of the technology. In this demo you will build, debug, and deploy a simple Hello World ASP.NET application using Windows Azure and have the application running on the web in less than 5 minutes.
Building and Deploying a Service In these demos you will walk through an entire Windows Azure Guestbook application that exercises many aspects of Windows Azure.
Windows Azure using Blobs Demo In this demo you will examine how blob storage is used within the Guestbook demo application
Windows Azure Worker Role Demo In this demo you will examine the worker role in the GuestBook demo application.
Windows Azure Using Queues Demo In this demo you will examine how queues are used to allow communication between web and worker roles within the GuestBook demo application.
Windows Azure Using Tables Demo In this demo you will examine the tables used by the Guestbook demo application.
Windows Azure VM Role In this demo you'll see how to connect to a VM role with Remote Desktop, how to create a VHD for VM role, and how to deploy a clean Windows Server 2008 R2 image.
Web and Worker Role Enhancements In this demo you'll see how to use Remote Desktop to connect to a Web Role, the power of Startup Tasks, and a simple way to implement multiple websites with Full IIS capabilities in Windows Azure.
Windows Azure Connect In this demo you'll see how to setup a virtual network with Windows Azure Connect by configuring a Web Role to connect to your computer.