Setting Azure storage account as cache location
Problem reported by Ryan Allan - August 21 at 4:03 PM
We are attempting to set our cache location to an Azure storage account and it appears to have worked but is throwing an exception during pre-caching. The exception is this:
Message = "Specified method is not supported."
"   at Microsoft.WindowsAzure.Storage.Blob.BlobWriteStreamBase.get_Length()\r\n   at GleamTech.IO.DelegatingStream.get_Length()
I did a quick google search and this appears to have changed a while back during an update to the MicrosoftAzure.Storage package. Is there a bug in the DocumentUltimate package regarding this?

3 Replies

Reply to Thread
Cem Alacayir Replied
Employee Post
We are using an older version (7.2.1) of WindowsAzure.Storage internally due to net40 support (after this version it requires net45). However I think the error you get is not a bug or related to WindowsAzure.Storage version. It's probably caused because you pass a stream without length to PreCache method. Try to read your original stream into a MemoryStream or a byte array and pass that to PreCache method.
For reference:
I did make a few changes to how we are calling pre-cache and this seems to have fixed the issue.
This appears to be a red herring. I applied the code changes to my local development environment and ran and had no problems, i can pre-cache and view files while using Azure Storage Account as cache location. However, i have two colleagues that cannot get this to work with the same code out of our GIT repository and if i deploy the code to Azure App Services, it does not work. So, I am the only one that has successfully gotten pre-caching and viewing from Azure Storage as cache location to work and I for the life of me cannot figure out what is different about my environment. All three failing environments throw the same exception that was posted in the beginning of this thread. Any pointers as to what to look into would be appreciated.
And P.S. I have tried with both MemoryStream and Byte arrays for pre-caching.

Reply to Thread