0
votes

I am trying to list all deleted blobs from an Azure Storage Account. Here is my code:

using Microsoft.WindowsAzure.Storage;
using Microsoft.WindowsAzure.Storage.Auth;
using Microsoft.WindowsAzure.Storage.Blob;

var blobClient = new CloudStorageAccount(new StorageCredentials("accountname", "accountkey"), true).CreateCloudBlobClient();
var container = blobClient.GetContainerReference("container");
var blobs = container.ListBlobs(useFlatBlobListing: true, blobListingDetails: BlobListingDetails.Deleted).ToList();

However, the result of ListBlobs is all non-deleted blobs in the container. In the Azure Portal I can clearly see there are many more deleted blobs in this container, but they are not being retrieved correctly.

How can I list only the blobs in deleted state in my container?