0

I am uploading files into a Azure Blob Storage Container virtual sub folder. Is there any way to retrieve the file names of this sub folder?i.e. images/192-168-2-44/img/ There are many thousands of files being written into the container, but I am wanting to write only the file names from that sub folder to azure Cosmos DB. Also as new files are written I would only want to update the db with new files. Any help on what technology, I could use would be very appreciated?

Regards,

Peter

  • 1
    Can you edit your question and include more details? How are you uploading the files? How are you writing data into Cosmos DB? Any particular SDK you're using to interact with Storage? Please include any relevant code in your question. – Gaurav Mantri Apr 22 '20 at 00:23
  • One thing to note: If this question is about how to be *alerted* to the addition of new blobs, so that you can proceed with moving content into Cosmos DB (or taking other actions), please see [this answer](https://stackoverflow.com/a/61342308/272109) I posted recently, that mentions how this can be accomplished with blob storage + event grid. – David Makogon Apr 22 '20 at 00:41

1 Answers1

0

I ended up finding how to show images in a subfolder.

public string subFolder = "192-168-2-44/img/";

foreach (IListBlobItem blob in blobContainer.ListBlobs(subFolder, useFlatBlobListing: true)) { if (blob.GetType() == typeof(CloudBlockBlob))

                    allBlobs.Add(blob.Uri);
            }