I am using the JS sdk to interact with Azure storage.
I have a hierarchy that looks like: demo (container name) / ID // list of files
So I am trying to get a list of files for a specific subfolder. I assumed using listBlobsByHierarchy was the one to use but I can not manage to get a list of blobs for that specific folder.
My code:
for await (const item of containerClient.listBlobsByHierarchy("/")) {
console.log(item, 'ITEM')
if (item.kind === "prefix") {
console.log(`\tBlobPrefix: ${item.name}`);
} else {
console.log(`\tBlobItem: name - ${item.name}, last modified - ${item.properties.lastModified}`);
}
}
which returns
{ kind: 'prefix', name: '5f09b7ab047f9804a861672d/' } ITEM
BlobPrefix: 5f09b7ab047f9804a861672d/
{ kind: 'prefix', name: '5f300119536cc32ce44c0013/' } ITEM
BlobPrefix: 5f300119536cc32ce44c0013/
{ kind: 'prefix', name: 'test/' } ITEM
BlobPrefix: test/
Now I would like to get a list of files inside folder 5f09b7ab047f9804a861672d for example
