After completing the tutorial on creating a .NET Web Application with SQL Azure, as discussed in this post, I started looking at storing data on the Cloud as a Blob. The Windows Azure website also contains a guide on how to use the Blob Storage Service and instead of going through the entire guide in a step-by-step fashion this time, I created a Revit app using which I decided to save some Revit data as Blob in the Cloud. In this post, I will discuss two of the ‘unexpected’ experiences in this yet-another experiential learning exercise (in case you happen to run into them too and find this useful).
The first was with referencing the Microsoft.WindowsAzure.StorageClient.dll in the Revit plug-in project. Like we do with Revit API dll references where we set the Copy Local flag for each Revit API dll to be False, as discussed in this blog post in Jeremy Tammik’s, ‘The Building Coder’ blog – I did the same with all the referenced dlls in my Revit app Visual Studio project (including the StorageClient dll). This resulted in an exception stating that it could not load the dll or one of its dependencies. After searching through various articles online, it seemed that for this specific DLL, the Copy Local flag should be set to true, which did help resolve this exception
The other exception which took me a while to resolve was with the exception which stated “One of the requested inputs is out of range”. After quite a lot of attempts, I was able to nail it down to the way I had set the name for the Container. Since it was a String type, it was not evident that having a name with Capital letters might be the cause of this. The container name I had used was something like ‘BIMCloudSync’ and it was indeed the cause for the exception. Changing the name to all lowercase helped resolve this problem. While attempting to resolve this exception, I came across another exercise on Working With Blobs on MSDN which specifies some rules with the container names.
(image source: http://msdn.microsoft.com/en-us/gg271293)
In my next post on this topic, I will share the details of the Revit app that I eventually created, which stores some data on the Cloud from a Revit model (and as you might have guessed already - it will be stored as a Blob).