Archive for the ‘Windows Azure AppFabric’ Category.

Article: Introducing the Windows Azure AppFabric Caching Service

I was excited to receive my MSDN Magazine in the mail this week, as an article written by myself and Karandeep Anand—a Principal Group Program Manager on the AppFabric team—was finally published.  These things generally take a month or so from the time you finish writing them, which is often challenging in a services world.

You can now read this article online: Introducing the Windows Azure AppFabric Caching Service

clip_image001

Don’t let the title deceive you – it’s not your typical “Introducing…” or “Getting Started” tutorial.  We wanted to delve deeper, and included:

  • Under the Hood
  • Architectural Guidance
  • Setup
  • Using Cache in Your App
  • What’s Next?

Karan and I are also giving a talk at MIX11 entitled Build Fast Web Applications with Windows Azure AppFabric Caching where we’ll not only build on foundational principals laid out in this article, but also show a lot of compelling demonstrations.

The best part is that you can start using the Caching service today as part of the Community Technology Preview (CTP).  Sign up at: https://portal.appfabriclabs.com/.

Windows Azure Platform Training Kit and Course, February 2011 Update

clip_image001[4]The February 2011 update of the Windows Azure Platform Training Kit includes several updates and bug fixes for the hands-on labs.   Most of the updates were focused on supporting the new Windows Azure AppFabric February CTP and the new portal experience for AppFabric Caching, Access Control, and the Service Bus.  The specific content that was updated in this release includes:

  • Hands-on Lab – Building Windows Azure Apps with the Caching service
  • Hands-on Lab – Using the Access Control Service to Federate with Multiple Business Identity Providers
  • Hands-on Lab – Introduction to the AppFabric Access Control Service V2
  • Hands-on Lab – Introduction to the Windows Azure AppFabric Service Bus Futures
  • Hands-on Lab – Advanced Web and Worker Roles – fixed PHP installer script
  • Demo Script – Rafiki PDC Keynote Demo

The setup scripts for all hands-on labs and demo scripts have also been updated so that the content can easily be used on a machine running Windows 7 SP1.

You can download the February update of the Windows Azure Platform Training kit.  We’re also continuing to publish the hands-on labs directly to MSDN to make it easier for developers to review and use the content without having to download an entire training kit package.  You can also view the HOLs in the online kit.

Finally, if you’re using the training kit or if you have feedback on the content, we would love to hear from you.   Please drop us an email at azcfeed@microsoft.com.

Managing the SecureString in the DataCacheSecurity Constructor

If you take a good look at the latest Release Notes for the Windows Azure AppFabric CTP February Release – or if you jump directly into the new SDK and try to programmatically configure the Caching client – you’ll quickly discover that the DataCacheSecurity class now requires a System.Security.SecureString instead of a string.

The reason for this change in the DataCacheSecurity constructor is to reduce the time that an unencrypted string remains in memory.  The expectation is that a user will read an authentication token in an encrypted file, and then construct the SecureString from it.

While this is well and good, it does make for some challenges when developing against the APIs.  Consequently, you may want to create a method that takes your authorization token string and returns a SecureString.

Note: Only use this method when you don’t need the to ensure that the authorization token stays out of memory.  In many ways, the below method defeats the purpose of SecureString.

Here’s what the method can look like:

Code Snippet
  1. static private SecureString createSecureString(string token)
  2. {
  3.     SecureString secureString = new SecureString();
  4.     foreach (char c in token)
  5.     {
  6.         secureString.AppendChar(c);
  7.     }
  8.     secureString.MakeReadOnly();
  9.     return secureString;
  10. }

Now, from your application, you can simply call this method and return the SecureString authorization token …

Code Snippet
  1. SecureString authorizationToken = createSecureString("TOKEN");

… which you can then pass into the DataCacheSecurity constructor (as outlined in this post).

While this does incur some overhead, it is pretty minimal since you should only construct the DataCacheFactory once during the application life time.

I hope this helps!