[英]Azure storage blobs, C#, how can I determine what blob is currently in use?
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 据我了解,我可以制作快照,然后完全关闭计算机(从azure门户使用deallocate),然后通过覆盖将一些快照复制回来
In this example I'm getting blobs into a collection: 在此示例中,我将blob放入集合中:
// 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: 但是存在名称相同但ETag不同的Blob:
How can I determine what blob is currently in use by virtual machine? 如何确定虚拟机当前正在使用哪个Blob?
How come you get blobs with same name? 您怎么会得到同名的Blob? Pring out the container name too, it may give you a clue which one is in use by the VM. 还要提供容器名称,这可能会为您提供VM正在使用哪个容器的线索。 There cannot be two blobs with same name within the same container. 同一容器中不能有两个具有相同名称的Blob。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.