fsprojects / AzureStorageTypeProvider

An F# Azure Type Provider which can be used to explore Blob, Table and Queue Azure Storage assets and easily apply CRUD operations on them.
http://fsprojects.github.io/AzureStorageTypeProvider/
The Unlicense
84 stars 34 forks source link

List blobs in folder #42

Closed thinkbeforecoding closed 9 years ago

thinkbeforecoding commented 10 years ago

There is only one operation on folders for blob containers to download all files in the folder. It'd be great to be able to list blobs in a folder to iterate on it. Like:

account.``path/``.``to/``.``folder/``
|> Seq.map (fun blob -> blob.Name)
isaacabraham commented 10 years ago

A good idea. This would bring the blob side of things more to a programmatic model than the current script-first style. It would probably need to bring in all children recursively (rather than just the immediate children).

It should probably be a method underneath the folder though e.g.

 account.``path/``.``to/``.``folder/``.``GetBlobReferences()``
 |> Seq.map(fun blob -> blob.Name)

Something I don't think that we want to do is just recreate the existing Azure SDK though.

thinkbeforecoding commented 10 years ago

The SDK enable to list only children or recursively.. Could be like

account.``path/``.``to/``.``folder/``.Children
 |> Seq.map(fun blob -> blob.Name)
account.``path/``.``to/``.``folder/``.Descendants
 |> Seq.map(fun blob -> blob.Name)

Or something like that... It's useful when you're interested in things bellow a certain level, but go through the first levels quickly in script..

isaacabraham commented 10 years ago

Yeah, I knew about the SDK - more about how you want to interact with it from the TP. I've created a branch, "folderBlobEnumeration" which gives a simple version of this - can you have a look at it and let me know your thoughts?

a5de09d17b4d626ac27b3b76aaaf635d5a4cc37d

Ta