I need to compare from a list that I have to the files in a blob storage of azure, the only part I need is a way to get a list of the files in that blob.
For example
blob azureImages files: name something.jpg asd.jpg iwda.jpg
my list:
name
something.jpg
asd.jpg
When I compare the files from the blob with my list, I’d like to delete the files that have no match in my list.
You can get a list of blobs in a container with CloudBlobContainer.ListBlobs() or inside a directory with CloudBlobDirectory.ListBlobs()
You’ll need to parse the file name from blobItem.Uri, but then you can use LINQ’s Except() method to find the difference:
which will return everything in the fromAzure list that isn’t in yourList.
And lastly you can delete the blobs with this example