3

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.

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

2 Comments

Actually, I don't need client-name or client-id. I think I've got permission to remove it completely. But still, It looks odd to me as I can't rename a blob, I can't rename container,I can't use something like URL-rewrite. What it means for me is that I can't quickly change URL for many images. Let's consider scenario,I have many images and we decided to change file names. For that, I need get blob and save with different name, If I have 1Tb,It will take ages. Of course I can create a service put it into cloud to do a job,but it is expensive for me as it takes a lot of my time for simple task.
Thank you very much. This is really helpful thing. It's interesting how fast CopyFromBlob is.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.