I'm querying Azure for "blobs" using FindBlobsByTagsAsync(), which returns something called Azure.AsyncPageable<Azure.Storage.Blobs.Models.TaggedBlobItem>
I need to run two separate queries (as there is no OR operator for this in the Azure blob query syntax), combine the results and return distinct results.
I've done this below without issue, but I'd like to run the two queries in parallel and then sort them after both are complete, and I'm struggling with this as the FindBlobsByTagsAsync() doesn't return a "Task" type?
These queries actually return really fast typically, but let's pretend they don't.
Thanks for any help!
Non-parallel code:
List<String> myBlobs = new List<String>();
await foreach (var taggedBlobItem in blobServiceClient.FindBlobsByTagsAsync(query1))
{ myBlobs.Add(taggedBlobItem.BlobName); }
await foreach (var taggedBlobItem in blobServiceClient.FindBlobsByTagsAsync(query2))
{ myBlobs.Add(taggedBlobItem.BlobName); }
return Ok(myBlobs.Distinct());