Reputation: 625
What I need is to rewrite URL for the requested blob, i.e. instead of http://myaccount.blob.core.windows.net/clients/{client-name}/images/imagefile.jpg should be served http://myaccount.blob.core.windows.net/clients/images/imagefile.jpg
The client name in the URL is a request to have SEO URL, as file names are unique and I'd like to have blob name as images/imagefile.jpg instead of {client-name}/images/imagefile.jpg and use something like URL rewrite in IIS. It becomes a pain if the client changes it's name as I can't rename a blob I have to create copy and delete the old blob. It may take more than a minute which we can't afford.
Upvotes: 3
Views: 4556
Reputation: 30903
You can't use anything like URL Rewrite for the storage accounts. You can only have custom domain mapped to your storage account. For example instead of referencing blobs with: http://myaccount.blob.core.windows.net/... you could map them to http://img.yourdomain.com/... And you could also use the Azure CDN for better performance and user experience!
Moreover, if you do care about SEO, you have to also think on not just "rename" the blob but also use HTTP 301 redirect from the old blob to the new one. Which also is impossible with Azure storage service. I suggest that you use client-id instead of client-name
UPDATE
You "can" reanme the blobs, simialry to the way you would rename files. Given your requirement - if you want to "quickly" rename a lot of images, you have to write simple "service" anyway, because I can't figure out another way to rename 1000s of files on the file system either. With the blobs, although beeing remote it will be almost the same. And you are wrong that you have to save the blob on the machine. There is new feature (method on the CloudBlob instance) since November'2011 release (I think), named CopyFromBlob. Here is an example of how to rename blobs.. This way you can easily move blobs even around different account without the need to first download the content. Yes, it may take a bit longer than with a local file system. But still this is a fair-enough solution.
Think about what the Azure Storage is. A massively scalable, reliable storage as a service. You have 100TB (subject to increase if required), with 3 copies locally + one copy in another geo region. A CDN support for this massive storage with more than 24 nodes worldwide. I don't think renaming is something of top need.
Upvotes: 2