Here is my user story for a website allowing users to add files into storage.
User clicks 'upload a file'
Browser requests an upload Url from the service.
Service creates a blob container in the user account
Service creates a time-bombed SAS url on the container, say, 1hr.
Service passes back the upload Url.
User, meanwhile, is choosing a file from disk (fileToUpload).
Upon selection of file and with the uploadUrl in hand, the browser does a PUT of the file to the SAS url + filename (putUrl).
When the upload is done, the browser notifies the service which revokes the SAS and starts processing the file (say, adding an uploaded jpg to a user-managed gallery).
Unacceptable architectural work arounds:
Uploading the file to the web-role or worker using a POST, and then having the service do the write to storage. Why not: This forces me to scale out my service to manage all the inbound bandwidth, Azure Storage is there for that, I shouldn't design a
bottleneck on purpose. Also, I may not geo-replicate the service, so the user's storage account may be across the globe from any intermediate upload service.
This can be implemented using the following simple calls:
To my knowledge, there have been no announced plans to enable CORS for Windows Azure blob storage.
Browser plugins (Silverlight or Flash) are potential workarounds.
FYI, I believe your use of "non-goal" is nonstandard. A non-goal is something desirable but out of scope. I was confused about this when I first joined Microsoft, as the term is used frequently there in specs.
I also saw your posts on this in other threads - at least two other requests similar to this, and much older. One of which asked for more details, so I added them here.
I have very real scenarios that need to push large files to Azure blobs without a middle-tier. Any specific suggestions for a Flash implementation?
Prefered would be a client that could make use of the proper Block Blob REST calls which would allow for threaded async uploads of 1Mb blocks using PUTs, and validating that they are all committed prior to declaring upload completion.
Thanks for the response. Let's assume what you're saying is true. If it is true, then this necessarily implies that the Microsoft's plug-in free strategy for Windows 8 is DOA for use cases like this. In other words if we want to
deliver content to our plug-in free apps to any platform who's browser is plug-in free (including Windows 8), and we need those resources loaded asynchronously, then Windows Azure is not our answer for such a storage and delivery capability. Window
8 not compatible with Windows Azure Blob Storage for Web Apps???? I find this extremely difficult to believe that CORS could be a "non-goal" and out of scope much longer. I would hope that good people like yourself at Microsoft would ponder a little
deeper on the many implications of this use case. In the mean time while I wait, I'm unfortunately forced to have at least part of my Windows Azure Web App delivered by Google's cloud storage.
Sorry about that Steve, did mean to tag you as an MS employee. You are also correct you can sub-optimally put square peg in round hole and route everything through a Web Role which unfortunately kills many of the benefits of cloud storage not to
mention incurring more costs. Perhaps the impact isn't as bad as I project, would like to hear your experience with such solution.
I have to agree all the way with Nick and Daron on this. CORS not being available in Azure Storage would render quite a few scenarios useless. Sure, we could use Web Roles as proxies / routers, but how about CDN? It would require us to deploy Webroles
in all datacenters in order to get Azure Storage content close to our users. Also, with this proxy 'solution' we would lose the great scalability of the Storge / CDN infrastructure....
Apparently in a presentation in Channel9 someone at Microsoft mentioned that CORS is actually on the radar. It would be very helpful if someone can confirm this is correct and shed some light on planning / availability.
easyXDM is a great open source library for solving cross-domain problems like this one. I did a proof of concept with Azure Blob Storage and recently wrote a blog post about it that includes a small demo: