I'm trying to list root directory in container.
Storage account: Data Lake Storage with hierarchical namespace ON
Interface used: BlobContainerClient
Folder structure
ROOT DIR:
dir1->blob2
blob1
auto listBlobOptions = Azure::Storage::Blobs::ListBlobsOptions();
auto blobPages = containerClient.ListBlobsByHierarchy("/", listBlobOptions);
std::cout << "Blob Reading" << std::endl;
for (const auto& blobItem : blobPages.Blobs)
{
std::cout << "******************" << std::endl;
std::cout << blobItem.Name << std::endl;
}
If I use "/" as delimiter, the directories that were created from Azure portal are not included. If I remove it, that all the blobs are being listed.
With "/" I would get only blob1, but without I would get
- dir1,
- blob1
- dir1/blob2
Reason for Storage account and interface mismatch is because we are using private endpoints with subresource type BLOB, and DFS is forbidden in such case.
If I would use ListBlobs or not use "/" that would read all the blobs in the storage accounts, which is kind of problematic since there could be huge amount of it.
