Tried using the ListBlobsSegmentedAsync method , but this returns only the blobs from the main parent directory level ..
But I need the entire list of blobs at one
The ListBlobsSegmentedAsync method has 2 overloads that contain the useFlatBlobListing argument. These overloads accept 7 or 8 arguments, and I count 6 in your code. Because there are so many arguments, you can use named arguments to make the code easier to understand.
The code below has been tested successfully in .NET Core.
BlobContinuationToken blobContinuationToken = null;
do
{
var resultSegment = await cloudBlobContainer.ListBlobsSegmentedAsync(
prefix : null,
useFlatBlobListing: true,
blobListingDetails: BlobListingDetails.None,
maxResults : null,
currentToken : blobContinuationToken,
options : null,
operationContext : null
);
// Get the value of the continuation token returned by the listing call.
blobContinuationToken = resultSegment.ContinuationToken;
foreach (IListBlobItem item in resultSegment.Results)
{
Console.WriteLine(item.Uri);
}
} while (blobContinuationToken != null); // Loop while the continuation token is not null.
This code is derived from Microsoft's storage-blobs-dotnet-quickstart repository.