Wednesday, 19 November 2008

Silverlight: and Windows Azure

In my last article I was discussing Silverlight and Amazon's new CloudFront service.

I wanted now to discuss what the options with Azure are?

Hosting your Silverlight application in Azure

You can obviously host your Silverlight Application by hosting your website (which includes your Silverlight app) in Windows Azure, but I thought I'd explore avoidin the website, similar to what i was suggesting doing with Amazons Cloud Front.

The good news is that you can actually host your html file, your silverlight .xap file (set the mime type correctly), you will even be able to interact with web / wcf services via clientaccesspolicy / crossdomain files. You can host your Silverlight application completely in Windows Azure today (subject to the terms of service).

There are some caveats however at the moment:

  • Your silverlight application won't be able to access private blob storage (can't sign the http request)
  • Your silverlight application won't be able to access table or queues
  • Haven't figured how to control cache yet (not saying it's not possible, I just haven't spent enough time to figure if it is possible)

To be honest I'm not sure I want my silverlight applications to access these services directly. Certainly not at the moment (wouldn't want my shared key in the wild). May'be with a good authentication method this would be attractive.

The big difference between CloudFront and Azure for this type of thing is:

  • Content Expiry / Caching
  • Terms of Service / Pricing
  • Low Latency due to multiple datacenters and good routing

As I said, I think when Azure is out this will be a non issue.

4 comments:

Jay Borseth said...

I've tested reading from Azure blob storage (images) from a Silverlight app, and this worked fine. What is the source of the difficulty using tables and queues?

chrishayuk said...

The difficulty is to do with private access.

Silverlight at the moment can't sign an http request with the shared key.

It works ok with blobs because you can have containers which have public access. You won't be able to access any of the private containers due to the signing issue.

Anonymous said...

You are right Chris - Amazon EC2 is pricey - it's a very nice service however.

I am very interested in running an all Silverlight application on Windows Azure (which I have already done - http://unique.cloudapp.net/default.aspx); however, I have a lot of high resolution images that I need to store and download on demand. I also need to be able to do credit card processing. I would love to use Amazon for credit card processing; however, they are pricey so instead I am going to try and use Google credit card processing which is a lot more reasonable. I am also thinking that maybe I would use Amazon for storing the images since storage on Amazon is very cheap.

I would appreciate help in understanding the issues of running Silverlight on Windows Azure. As a beginner, I would assume that I could create both a Windows Azure Silverlight application and a separate Windows Azure web service. The Silverlight application would run on the user's machine and interact with the Azure web service which should be able to access private blog storage and tables. The Silverlight app running on the user's machine should also be able to interact with Google credit card processing and Amazon storage (with proper cross domain policy files in place).

Of course the devil is in the details - I would certainly be willing to working with anyone to help resolve the details.

Anyway, were am I showing a lack of understanding?

Any help would be greatly appreciated (especially the details :-) for example, I would like to be able to use my own domain name instead of cloudapp.net which I suspect that I can but I don't understand how elastic IP's work - any link reference to appropriate material would be appreciated.

Thanks for writing the articles on Windows Azure and Amazon.

David Roh
JK@SilverlightAzure.com

chrishayuk said...

Yes,

You can use Amazon to serve up the content (cheaply), if you are not too fussed about Worldwide latency, you could easily use Windows Azure Blob Storage Service, and put your images in a public container (content expiry / caching is an issue for this however) within your storage account. Remember of course that azure is free just now (within terms of service).

I think I'll write a post on this, but essentially if you ping your IP address for http://unique.cloudapp.net/ , you will be able to stick a DNS address against your own domain, with your DNS Host.

At the moment I believe there is a one to one mapping, and I don't think they will change this IP address / method (but they might), so you would need to monitor it.

I do believe they will be offering the ability to stick your own Domain Name against it (properly) in the future, so this should get you going for just now.