I'm storing blobs in virtual folders, using the current date as folder name. I need the names of the blobs to be unique, but I also need to be able to search within the folders to pick certain files (e.g. filename startswith(id)).
Below is the code i'm using to store the blobs.
#r "Microsoft.WindowsAzure.Storage"
using Microsoft.WindowsAzure.Storage.Blob;
public static async Task Run(string input, Binder binder, TraceWriter log)
{
string path =
"container/{DateTime.UtcNow.ToString("yyyy/MM/dd/HH")}/{someid}-
{someguid}.json";
var attributes = new Attribute[]
{
new BlobAttribute(path),
new StorageAccountAttribute("<storage connection>")
};
using (var writer = await binder.BindAsync<TextWriter>(attributes))
{
writer.Write(input);
}
}
I know it is possible to search the folders using the SDK, but I really want to be able to do searches on virtual folders in a blob storage, using an imperative binding. E.g. i want to fetch all blobs stored the last 5 days.
Any ideas?