我有一个名为“images”的天蓝色容器,但我无法弄清楚如何获取存储在此容器内的所有blob
答案 0 :(得分:4)
我找到了答案:
// We get reference for the container (by name "containerName" variable)
container = blobClient.GetContainerReference(containerName);
// We create the container if this container is not exists
container.CreateIfNotExist();
// Set permissions
var permissions = new BlobContainerPermissions
{
PublicAccess = blobContainerPublicAccessType.Blob
};
container.SetPermissions(permissions);
// Get list of all blobs URLs which are stored inside container
IEnumerable<IListBlobItem> blobs = container.ListBlobs();
return blobs.Select(item => item.Uri.ToString()).ToList();