Reputation: 378
I have Azure Blob containers with several hundred Blobs per container. When querying for the file list with the GET LIST command through the REST API I indeed get a list, but it's an XML with lots of additional information, like "last modified" and such. This makes the returned list around 500 bytes per file. For a container with 200 Blobs, this makes for 100 kilobytes just for getting that list. This is horribly inefficient, especially since the files themselves are only around 10 kilobytes each and I need to request the list quite often.
I don't see any options in the documentation for GET LIST to return a simpler list. I only need blob names, without complete URLs and without any additional information, as small and basic as possible. For short file names, this could fit in as little as 5 bytes per file.
Is there some more efficient way to get a file list from an Azure Blob?
As for why I need this: I have a system where several users can upload Blobs simultaneously and others download specific Blobs shortly after.
I considered having a web role that tells users what to download, but wouldn't that Web role under the hood incur the same download cost from the Blob when I use the C# Blob API to list the files in the Blob? Price is a serious consideration for us here since we expect a lot of users interacting with this.
Upvotes: 0
Views: 310
Reputation: 6467
I don't know a way to only return blob name in response payload. However, if you deploy your web role under the same region as your storage account, the response payload doesn't impact the price actually since you don't need to pay for traffic within region: https://azure.microsoft.com/en-us/pricing/details/storage/
Upvotes: 3