I have a fairly large Windows Azure migration I’m working on, and there are dozens of tips, recommendations, gotchas, etc. I’ve learned in the process. This is one small item that cost me quite a bit of time, and it’s so simple I’m detailing it here because someone will run into this one.
First a bit of background: if you’re deploying a Windows Azure application, the package is uploaded and deployed as a whole. If you have dynamic content or individual files that are subject to change, it’s a good idea to consider placing it in Azure Storage, otherwise you’ll have to redeploy your entire application to update one of these files. In this case, I’d like to put a Silverlight XAP file in Azure storage, instead of the typical /ClientBin folder.
There are a number of references on the net for setting this up – searching for “XAP” and “Azure” returns a lot of good references including this one. After checking my Silverlight project’s app manifest file, ensuring everything was correct, and uploading the XAP to my Azure storage account, my Silverlight app would refuse to run. The page would load, but then … nothing. I also checked Fiddler – the XAP file _was_ getting downloaded (and was downloading fine via a browser). This is typically a tell-tale sign of a policy issue – yet I was certain everything was correct. Here’s a screenshot (click for larger) of Fiddler downloading the file. Can you spot the problem here?
The problem was indirectly with Cerebrata’s Cloud Storage Studio. Cerebrata’s product is really nice and I enjoy working with it quite a bit to work with Azure storage (uploading/downloading files). CloudBerry’s Explorer for Azure Blob Storage is another good one – I typically work with Cerebrata’s simply because it was easier to connect to development storage (not sure if this is possible in CloudBerry’s app).
Fast-forward and hour or two of frustration. Staring at Cloud Storage Studio, I see:
Zip file as a content type? This was in the Fiddler screenshot above, too. I figured this was fine because after all, a XAP file is a zip file. But as it turns out, this was the problem. For kicks, I tried re-uploading the XAP file from CloudBerry to see how it handled the content type, and:
Cloud Storage Studio does allow you to alter the content types, but truthfully I didn’t think this was all that important. When I reloaded my application, though, the app loads and Fiddler comes to life as it should:
For kicks I changed the content type back to Zip, and the app would fail to load. So, lesson learned! Don’t forget about the content types.