0

The Python SDK for Azure provides the list_blobs method for listing blobs present in a container using a container name, prefix and a delimiter.

The Node.js based azure-cli also provides an option for listing blobs

azure storage blob list [options] [container] [prefix]

I checked the help for the above mentioned command and couldn't find an option for using a delimiter.

Is there a way for using a delimiter with the above mentioned command ?

Aatif Akhter
  • 2,126
  • 1
  • 25
  • 46
  • Can you explain what you're trying to do? It is not very clear how you would like to use the "delimiter". – Gaurav Mantri Sep 14 '16 at 01:49
  • I'm trying to list the contents of a container so that the output appears like a directory listing. Using list_blobs from the Python SDK, this is something on these lines : list_blobs(container, delimiter="/", prefix="some_prefix/") which gives the output : some_prefix// (if the blob is a directory) – axon_synapse Sep 14 '16 at 02:57

2 Answers2

0

Is there a way for using a delimiter with the above mentioned command ?

As of today, no. There's no option to specify a delimiter when listing blobs in a blob container.

CLI Tools source code is available on Github: https://github.com/Azure/azure-xplat-cli. What you could do is raise an issue there and ask for this feature or try to implement this feature yourself. The file where you would be making changes is: https://github.com/Azure/azure-xplat-cli/blob/dev/lib/commands/storage/storage.blob._js.

Gaurav Mantri
  • 128,066
  • 12
  • 206
  • 241
0

As of now, there is:

$ az storage blob list -h
...
    --delimiter                    : When the request includes this parameter, the operation returns
                                     a :class:`~azure.storage.blob.models.BlobPrefix` element in the
                                     result list that acts as a placeholder for all blobs whose
                                     names begin with the same substring up to the appearance of the
                                     delimiter character. The delimiter may be a single character or
                                     a string.
...
Mathieu Longtin
  • 15,922
  • 6
  • 30
  • 40