Reputation: 1076
I am writing console app to list and snaphot/restore azure blobs. As I understand, I can make snapshot, then fully turn off the machine(from azure portal, with deallocate), and copy some snapshot back with overwrite
In this example I'm getting blobs into a collection:
// get storage account based on credentials
CloudStorageAccount storageAccountObj = new CloudStorageAccount(creds, false);
// move all blobs to collection
CloudBlobClient blobClient = storageAccountObj.CreateCloudBlobClient();
var containers = blobClient.ListContainers();
List<CloudBlob> blobsArray = new List<CloudBlob>();
foreach (var container in containers)
{
foreach (var listBlobItem in container.ListBlobs())
{
var blobItem = (CloudBlob)listBlobItem;
blobsArray.Add(blobItem);
}
}
// display blobs
DisplayBlobCollection(blobsArray);
But there are blobs with same names but different ETag's:
How can I determine what blob is currently in use by virtual machine?
Upvotes: 0
Views: 242
Reputation: 30903
How come you get blobs with same name? Pring out the container name too, it may give you a clue which one is in use by the VM. There cannot be two blobs with same name within the same container.
Upvotes: 1