Archive for November, 2008

Peeking Windows Azure Queues using Windows PowerShell

Sometimes you have messages in a queue, and you want to have a peek at them (or even read and remove them). The most obvious answer to this is to build a little utility that allows you to browse queues, peek messages etc. But did you already know the CloudDrive Windows PowerShell provider already lets you do it!

Here is how you can get at the queues.

  1. Extract samples.zip to a folder, and using the buildall cmd – build all the samples.
  2. Navigate into the samples\CloudDrive folder, and execute the runme.cmd. This will install the PowerShell provider ready for use.

You should now be in PowerShell, and be able to issue commands such as

dir blob:

and

dir queue:

you can even execute

cd blob:

and use dir etc. to navigate the blobs.

So now for the queue, my queue is called messages so executing

dir queue:\messagequeue

yields

image

as you can see i have a single message in the queue. To read the message, first I need a reference to a queue.

$q = (dir queue:\messagequeue)

I can now call get-member on the $q object and view a list of methods and properties available.

$q | get-member

image

Note we have all the methods available in the queue, including PeekMessage. To read that first message I can call

$q.PeekMessage()

Which gives:

image

Finally, I can view the contents of the message using

$q.PeekMessage().ContentAsString()

Which gives my message content.

image

Hopefully using this little starter, you will be able to figure out how to create and manipulate queues and messages.

THIS POSTING IS PROVIDED "AS IS" WITH NO WARRANTIES, AND CONFERS NO RIGHTS

Share this post :

Hands on Labs Updated

We’ve just published the latest Azure Services Training Kit to http://www.microsoft.com/downloads/details.aspx?FamilyID=413E88F8-5966-4A83-B309-53B7B77EDF78&displaylang=en. This contains updates and bug fixes to the original kit. The kit contains hands on labs for Windows Azure as well as .Net Services, SQL Services & Live Services.

The kit includes the following labs:

Windows Azure

  • Building Windows Azure Services
    In this lab, use the Visual Studio tools to build, package and execute a Windows Azure Service running on the local developer fabric. Also, learn about using Windows Azure configuration settings, local file storage as well as the logging API. Finally, use Visual Studio to debug your service.
  • Getting Started with Windows Azure Storage
    In this lab, examine each of the foundation storage capabilities of Windows Azure, Blobs, Tables and Queues. Discover how to create storage accounts; upload and retrieve blobs and blob metadata; create, update and query tables; and create a simple service that uses a message queue for communication.
  • Using Windows Azure Tables
    In this brief lab, you will perform the actions required to create, update and query tables in the Windows Azure Storage Service.

SQL Services

  • Introduction to SQL Data Services
    This lab introduces the basic data storage model for SQL Data Services (SDS), called the ‘ACE’ model (Authorities, Containers, and Entities). You will learn how to perform CRUD (create, read, update, delete) operations in SDS for blobs and flexible entities using the SOAP and REST protocols as well as how to perform basic query operations.
  • Advanced SQL Data Services
    Beyond the basics, developers will want to understand some of the more advanced features of SQL Data Services (SDS). In this lab, learn how to use the relational features, like JOIN, TOP, and OrderBy. Preview the new ADO.NET Services client interface to SDS and learn to manage concurrency with your applications.
  • Working with Concurrency
    In this Hands-On Lab, you will learn how to use the simple optimistic concurrency available to you with SQL Data Services. You will create a solution with two console applications: One to generate CRUD operations with concurrency using the REST interface and another identical application using the SOAP interface. Additionally, you will learn how to deal with managing concurrency for large entities or blobs using the HEAD operation.

.NET Services

  • Introduction to the .NET Service Bus
    This lab covers the basics of the .NET Service Bus in .NET Services. It shows how to connect clients and services via SOAP and REST over the Service Bus using the .NET Services SDK. It explores the different bindings you can use, shows how to expose a MEX endpoint, and also how to handle message security and binary data.
  • Introduction to the .NET Access Control Service
    This introductory hands-on lab walks you through the creation of a trust relationship with a sample third party, FederatedIdentity.net (a site used for interop testing with other identity management stacks). It then demonstrates how to leverage claims transformation rules provided by the .NET Access Control Service for implementing a simple but extremely effective access control strategy, one that in a more traditional scenario would entail a significant amount of resources.
  • Introduction to the .NET Workflow Service
    This lab demonstrates how the .NET Workflow Service can be used for service orchestration in the cloud. It covers the design of workflows using the specialized cloud-based activities and the deployment and management of workflow types and instances using both the .NET Services portal and the client-side management API.

Live Services

  • Creating Mesh-enabled Web Applications
    This introductory hands-on lab walks you through the creation of a trust relationship with a sample third party, FederatedIdentity.net (a site used for interop testing with other identity management stacks). It then demonstrates how to leverage claims transformation rules provided by the .NET Access Control Service for implementing a simple but extremely effective access control strategy, one that in a more traditional scenario would entail a significant amount of resources.

We are continuing to develop the Azure Services training Kit as the services evolve. Please post any feedback you may have to this blog.

THIS POSTING IS PROVIDED "AS IS" WITH NO WARRANTIES, AND CONFERS NO RIGHTS

Technorati Tags: ,

Windows Azure TechEd GuestBook Code

Thanks to everyone who came to my TechEd talks. It was great to see so many people interested in the topic & the witty comments in the feedback. For those that attended the final session, I’ve attached the zip of the Guestbook, which you can download. I’ve took it down from Live today, but thanks to those who posted photos!

Update: In my haste, I added the wrong solution below is the correct solution!

Download the REAL solution

THIS POSTING IS PROVIDED "AS IS" WITH NO WARRANTIES, AND CONFERS NO RIGHTS

Technorati Tags:

TechEd EMEA – Barcelona & Windows Azure

Welcome to Barcelona. I’m back in Barcelona again for TechEd EMEA Developer. I’m presenting 2 sessions on Windows Azure, as well as hosting a Q&A session. The Windows Azure sessions are:

PDC201 – A Lap Around Windows Azure – Wednesday 12th  9:00 – 10:15 – Rm 111

In this session I will give an overview of Windows Azure.

PDC201 – Developing and Deploying Your First Cloud Service – Wednesday 12th 17:30 – 18:45 – Rm114

In this session I will build an entire service using Windows Azure, starting from File, New project in visual studio and ending with deploying it to the cloud. Some if it will be written in C# and some in VB!

The Q&A session is currently scheduled for midday Wednesday

PDC02-IS – Microsoft Services Q&A – Wednesday 12th 13:30 – 14:45 – Rm 128

I’ll also be in the Ask the Experts area on Wednesday 12th – 12:45 – 13:15 & Thursday 13th 12:45 – 13:15. Drop by and say hello!

THIS POSTING IS PROVIDED "AS IS" WITH NO WARRANTIES, AND CONFERS NO RIGHTS