The Marriage of Cloud and Mobility

Anybody that follows me or my blog knows that I’m a huge proponent of using a cloud platforms such as Windows Azure to power new mobility applications.  Windows Azure offers so many great features that it seems silly to me to not even at least consider Windows Azure as a way to power a Windows Phone, iOS, or Android application.

Recently I had the opportunity to sit down with Tim Huckaby for a Bytes by MSDN video.  In this session Tim and I discuss helping customers to adopt Windows Azure, creating logical environments (development, QA, production, etc.) in Windows Azure, and some insights into using Windows Azure with Windows Phone applications.

Bytes by MSDN Interview - Michael Collier

Be sure to follow the links below for a quick way to get started today with Windows Azure and Windows Phone.

Detroit Day of Azure – Presentations

On Saturday (3/24/2012) I was honored to be a speaker at Day of Azure in Detroit.  The community in the Heartland is amazing!  The event sold out!!  It is great to see 144 passionate people attend a daylong event to learn more about the possibilities with cloud computing and Windows Azure.

A huge “thank you” should go out to David Giard and the other volunteers at Day of Azure for putting on such a great event. They really did a wonderful spreading the word and hosting the event.  Oh, and the BBQ for lunch . . . oh so very good!

I gave two sessions at Day of Azure – “Windows Phone 7 and Windows Azure – A Match Made in the Cloud” and “Building Hybrid Applications with Windows Azure”.  I was asked by several attendees if I’d be making the presentation available, and so I am.  You can take a look these, and a few other of my presentations, over on SlideShare.

The Hybrid Windows Azure Application

Windows Phone 7 and Windows Azure – A Match Made in the Cloud

MSDN Webcast: Windows Azure Office Hours, featuring Mike Benkovich

Last Friday I had the pleasure of joining Mike Benkovich for his weekly Windows Azure Office Hours webcast.  Windows Azure Office Hours is a webcast where Mike interviews a Windows Azure expert and also answers questions posted to the site (before the show and LIVE)!  I was honored to join the list of guests that included Mike Woods, Adam Grocholski, Paul Stubbs, Mark Russinovich, and Scott Klein.

For the Windows Azure Office Hours last Friday, Mike and I discussed a wide range of topics related to Windows Azure.  We discussed how I got started working with Windows Azure, my involvement with the excellent Windows Azure Boot Camps, and we spent quite a bit of time talking about the NuGet packages from Microsoft’s Developer Platform Evangelism team that help Windows Phone developers easily use Windows Azure.

During our conversation, I walked through a full demo that showed how to use the NuGet packages.  The demo showed how to quickly create a simple Windows Phone application that uses Windows Azure Access Control Services (ACS) to secure the application.  I also showed how to easily use Windows Azure tables, blobs, and queues from the Windows Phone app, and to do so securely by using a proxy web service that is secured with ACS.  All that was done in about 20 minutes!

Watch a recording of the webcast or download it now.

If you’d like to explore the tools and NuGet packages I showed, please check out the list of resources below.


Your Apportunity: Windows Phone + Windows Azure

It’s the last few weeks of the year.  Hopefully those “death march” projects are finally over.  It’s time to lay off the Mt. Dew, at least a little, and spend some relaxing, learning, and finally do those fun side projects you’ve wanted to do all year but never had the time to do.  One of those projects should be taking time to learn about Windows Phone or Windows Azure.  Mobile and cloud computing were all the rage in 2011, and it’ll surely continue in 2012.

It’s no secret I love working with Windows Azure.   As much as I love working with Windows Azure, it can be a hard technology to actually “see”.  After all, it’s “the cloud”, right?  Without some sort of user interface, it can be hard to get excited about the benefits Windows Azure can offer.

This is where Windows Phone enters the story.  I personally use a Windows Phone and find it to be an excellent product.  It’s also happens to be a platform that is actually really easy to write applications for.  As a developer at heart, I enjoy trying to create fun applications and Windows Phone gives me a fun new environment to create those applications.

When creating Windows Phone applications, you’ll often find yourself needing to get data to your application or save data from your application.  You already know Windows Azure offers many great options for working with data, it seems only natural to leverage Windows Azure as a platform to help build a Windows Phone application.  You can access data by connecting to a WCF service that is fronting a SQL Azure database.  Or, you may decide that a NoSQL approach to your data needs is best, and in that case you can use Windows Azure’s table storage service.  If you need to store items that don’t fit a NoSQL or relational data model, let’s say pictures taken from Windows Phone, then you can use Windows Azure’s blob storage.

It’s easy to get started doing just this.  To do so, the appropriate toolsets will be needed.

If you’re looking for some nice libraries and controls that can make building Windows Phone applications that use features of Windows Azure such as storage or Access Control Services, be sure to check out some of the new NuGet packages Microsoft recently released.  The easiest way to get started is by watching Cloud Cover episode 66.  In that episode Wade Wegner and Steve Marx provide an overview of using these NuGet packages.  Definitely worth checking out!

Once the application is created, you’ll  want to publish the application to the Windows Phone marketplace so that you can share your creation with friends, family, and hopefully a few million other Windows Phone users.  Microsoft has been running a promotion for a few months now that offers developers that submit new Windows Phone applications to the marketplace a chance to win a slick new Samsung Series 7 Slate PC.  So not only can you have fun writing a Windows Phone application, share that app with a lot of people, but also potentially win a cool new slate PC!  Since the application uses Windows Azure, you earn an extra entry to the contest!  As Charlie Sheen would say, “WINNING!”

To enter the contest, go to to register, and use the promo code “MCOLL”.  You’ll find all the contents details there.  The contest ends on December 31, 2011 – so get slinging that code now peoples!

Go Mango!

It’s no secret, I love my Windows Phone 7 phone!  I dumped my (and my wife’s) iPhones about a year ago now in favor of the new Windows Phone 7 (Samsung Focus).  I haven’t regretted that decision once.  Now, with the new Mango updates to Windows Phone 7, I’m even more in love than ever before.

As a developer, one of the things I love about my Windows Phone 7 is that it is really easy to write applications for it.  I already have Visual Studio 2010, already know .NET, and know just enough Silverlight to be dangerous.  Since I work with Windows Azure all the time now, being able to easily combine my Windows Phone 7 apps with the power, flexibility, and ease of Windows Azure just warms the cockles of my geeky heart!

If you haven’t joined in on the fun yet, now is a great time!  Why, you say?  Well, besides being one of the cool kids and earning the admiration of all your friends, you can also win a slick Samsung Series 7 Slate!  From now until the end of 2011, for every new Windows Phone 7 Mango app you submit, you’ll be entered to win 1 of 5 Samsung Series 7 Slates.  Nice!  But wait . . . there’s more!  If you submit 5 apps you’ll also be entered to win free advertising for the app of your choice.

Don’t forget – Windows Azure makes a great platform for powering your Windows Phone 7 apps!  You’ve got a world-class Content Delivery Network, powerful storage services (tables, blobs, queues, and SQL Azure), flexible compute instances (e.g. for serving up your WCF services that your app will consume), easy to use authentication via Access Control Services (for simply integrating with Facebook, Google, Windows Live ID, etc.), and the Windows Azure Marketplace full of fantastic data sets.

So what are you waiting for!  Go get all the tools you need and get in on the action now by signing up at

Also, be sure to sign up at to be notified of all the latest and greatest promotions and events from the fine folks at Microsoft User Community.

Many New Windows Azure Platform Features – Part 1

There have been quite a few recent updates to the Windows Azure Platform.  This post is partially to serve as a reminder to me of some of the new areas of the platform I need to dive into, and partially to help spread the word about many of the new innovations available today.  This is the first of probably several posts this week.  BUILD is going on now.  I’m sure there will be lots of exciting things to talk about after the magic and mystery is unveiled shortly.

SQL Azure Updates

Microsoft recently completed a rollout of an update to SQL Azure that will bring several new features and improvements to SQL Azure. I would encourage you to check out the two-part announcement post at for the full details.  Below I’ll take a quick look at the new SQL Azure Management Portal.

When logging into the new SQL Azure Management Portal, you may be presented with an error related to your firewall rules.  If so, just click the “There was an error connecting to the server” link below the Password textbox to view the error details. Verify the error was related to the SQL Azure firewall rules, update your rules, and try to log in again.

There are lots of really nice new features and UI enhancements in the updated SQL Azure Management Portal.  For instance, there is a new Summary page that provides a very nice rundown of the database you’re working with.

The new Tables page provides an easy to view listing of all the tables in the selected tables.  You can quickly select a table and decide if you’d like to view the data in that table or adjust the schema.  The icons for those actions are easy to recognize – very Metro UI like.

Windows Azure Autoscaling Application Block

One of the most common questions I get asked about Windows Azure is “does Windows Azure automatically scale my application”.  My answer so far has always been along the lines of automatically scaling an application is often not a trivial operation, and that there are lots of things to consider when scaling (elasticity – both in and out, cost implications, what metrics to use for scaling, etc.)  If you wanted some autoscaling features, you were often left with either writing a solution yourself or working with a provider such as Paraleap and their AzureWatch service.

That story looks like it is about to change.  Earlier this week Microsoft released a preview of a new library from the Patterns & Practices team that promises to help with scaling your Windows Azure applications.  The Windows Azure Autoscaling Application Block (WASABi) is a library that allows you to set rules for how your application should scale.

Look here for a future post soon demonstrating some of the features of the Windows Azure Autoscaling Application Block.

More details on the features enabled in the preview, and items planned for future releases, can be found at

Sync Framework v4

Another common ask when speaking with people about Windows Azure and SQL Azure is related to how to synchronize their data.  One possible solution for SQL Azure and/or SQL Server 2008 synchronization is the SQL Azure Data Sync CTP. This will allow you to sync SQL Azure with SQL Azure, or SQL Azure with SQL Server (on-premises).  But what if the need is not to sync data between servers/services, but between the cloud and any number of devices such as Windows Phone 7, an iPad, HTML5 applications, or other portable devices?  The newly released Microsoft Sync Framework v4 looks to help solve this problem.  Read more about the Sync Framework Toolkit at

Accessing a Service on the Windows Azure Service Bus from Windows Phone 7

Recently I was working on putting together a sample of how to use the service relay feature of the Windows Azure Service Bus.  By using the Windows Azure Service Bus as a service relay, it is possible to expose on-premises services in a secure way, without the need to punch holes in your firewall or stand up a lot of new infrastructure.  Part of the sample included accessing the service from Windows Phone 7.  Easy enough, right?

Setting up the server side to register on the Service Bus is fairly straightforward.  There are several good examples online, the Azure AppFabric SDK, and the Windows Azure Platform Training Kit.  So, I’m not going to go into much detail here on that.  However, I do want to be sure to point out that services can have one of two types of client authentication – none and an access token.  Obviously, not requiring a token is a lot easier – just call the service like any other WCF REST service.  Adding a security token ups the complexity a little.  By requiring an access token a client would need to authenticate with Windows Azure Access Control Services first, and then provide the token as part of the service call.  An area that can be confusing when dealing with authentication in this situation is the Service Bus still uses ACS v1 for authentication, not the newer, cooler, ACS v2.  You will see in the Windows Azure Management Portal that the Service Bus is set to use ACS V1, but when you look at Access Control in the portal, you’ll just see your ACS V2 namespace.

The client security requirement is configured in the server side .config file.

 <binding name=""> 
 <!--<security relayClientAuthenticationType="None"  mode="Transport"/>--> 
<security relayClientAuthenticationType="RelayAccessToken"  

Now that I had the server side set up, it was time to work on the WP7 side of the sample.  As I mentioned before, there are a lot of samples available for setting up both the service and client side of a Service Bus connection. What there was not (at least that I could find) was examples of setting up a client to authenticate with ACS, without using assemblies from the Azure AppFabric SDK such as Microsoft.ServiceBus.dll.  Adding to the “fun” was that all web calls on Windows Phone 7 must be done asynchronously – meaning the System.Net.WebClient behaves a little differently on WP7 than it does on a desktop or server app.  So, that said, let’s get on with it! 

There are two things that are needed – authentication with ACS and sending the ACS provided token to the service.  Let’s start with authenticating the client with ACS.  For my sample I decided to go with what is the most basic form of authentication, a shared secret.  This will involve creating a WRAP message, sending it to ACS, and then extracting the ACS token from the response.

private void GetDataUsingAcsSecurity()
 var webClient = new WebClient();             
 string acsUri = 
string data = 

 webClient.Headers["Content-Type"] = 

 webClient.UploadStringCompleted += webClient_UploadStringCompleted;
 webClient.UploadStringAsync(new Uri(acsUri), "POST", data);         

There are a few things to point out about this code.  Now, maybe it’s because I haven’t written a lot of C# code to access a REST service, some of the code to make this work were not obvious to me.   First, you must set the “Content-Type” HTTP header.  Second, you’ll want to use the STS Endpoint that is listed in the Windows Azure Management Portal.

STS Endpoint

So, now we need the code to handle the response.  That code will need to extract the ACS token from the response and pass it on to the service.

void webClient_UploadStringCompleted(object sender, UploadStringCompletedEventArgs e)
string token = 
e.Result .Split('&').Single(x => x.StartsWith("wrap_access_token=",
string decodedToken = HttpUtility.UrlDecode(token); 

var uriBuilder = 
new UriBuilder(;

uriBuilder.Path += 
string.Format("/claim/{0}/amount", PolicyIdBox.Text); 

var webClient = new WebClient(); 
webClient.Headers["Authorization"] = 
string.Format("WRAP access_token=\"{0}\"", decodedToken);

webClient.DownloadStringCompleted += 
(s, args) => ParseAndShowResult(args);


The key, at least for me, was the line which decodes the token received from ACS.  Note – ParseAndShowResult() is simply a helper method to parse the result of the service call and show on the phone, so nothing exciting going on there.

In the end, this wasn’t all that bad.  The problems for me were really related to a lack of understanding of what was needed with regards to authenticating with ACS and likely a little inexperience in working with REST services.  Hopefully this quick sample will save someone else from some frustrating 2:00 AM coding sessions.