这是代码
IEnumerable <IListBlobItem> blobs = blobDirectory.ListBlobs(new BlobRequestOptions
{
UseFlatBlobListing = true,
BlobListingDetails = BlobListingDetails.Snapshots
});
List<CloudBlob> cloudBlobs = blobs.Select(r => (CloudBlob)r).Where(r => r.SnapshotTime.HasValue).ToList();
foreach (CloudBlob cloudBlob in cloudBlobs)
{
cloudBlob.DeleteIfExists();
}
即使它正在由另一个实例挂载,它也会删除所有快照!并且实例安装了快照,因为磁盘不可读,不可用等错误,就像网络驱动器已经消失一样。
有没有办法删除当前尚未使用的快照?