I was recently asked to run a comparison of the blobs in two Azure Storage Accounts, where they should contain the same blob entries. However, some of the entries had been deleted from one account. Since it requires scanning the whole account it is expensive in cost and time. The fastest mechanism I found (and I’m sure there are better ways, please comment) was;
var blobsInBackupContainer = backupContainer.ListBlobs(useFlatBlobListing: true).OfType<CloudBlockBlob>().Select(b => b.Name); var blobsInPrimaryContainer = primaryContainer.ListBlobs(useFlatBlobListing: true).OfType<CloudBlockBlob>().Select(b => b.Name); var missing = blobsInBackupContainer.Except(blobsInPrimaryContainer); Console.WriteLine($"Missing count {missing.Count()}"); foreach (var item in missing) { Console.WriteLine($"Missing item = {item}"); }