I am working with Azure Blobstorage where I have a total of 100 blobs, however, I am interested in listing only the first 10 blobs. Is there a way to achieve this?
Even after using {maxResults:1}
, it seems to have no effect as all the blobs are still being listed.
Below is the function code I am using:
for await (const blob of containerClient.listBlobsFlat( {maxResults: 1} )) {
const blockBlobClient = containerClient.getBlockBlobClient(blob.name);
const downloadBlockBlobResponse = await blockBlobClient.download(0);
const download = await blobToString(await downloadBlockBlobResponse.blobBody)
allblobs.push(download)
}
return allblobs
}