public void CleanupUnattachedDisks()
{
// get all of the disks in the subscription
var command = new GetVirtualDisksCommand()
{
SubscriptionId = SubscriptionId,
Certificate = ManagementCertificate
};
command.Execute();
var disks = command.Disks;
// initiate the blob delete
// iterate through the disks and clean up the unattached ones
foreach (var disk in disks)
{
// get the blob details
//string storageAccount = ParseBlobDetails(disk.MediaLink);
//IBlobClient blobClient = new BlobClient(SubscriptionId, StorageContainerName, storageAccount, ManagementCertificate);
DeleteNamedVirtualMachineDisk(disk.Name);
// delete the underlying blob
//blobClient.DeleteBlob(disk.Name);
}
}