使用 Azure Data Lake gen2 列出 blob 时出现问题

Problem to list blobs with Azure Data Lake gen2

我使用 Azure Storage(Blobs) 来存储文件。

现在我正计划迁移到 Data Lake Gen2。不幸的是,在我将连接字符串切换到 gen2 存储后,它在 ListBlob() 方法上向我显示 400 Error with Bad Request。

代码示例:

var storageAccount = CloudStorageAccount.Parse(connectionString);
var myClient = storageAccount.CreateCloudBlobClient();
var container = myClient.GetContainerReference(containerName);
var dirRef= container.GetDirectoryReference(directory);
var blobs = dirRef.ListBlobs();

因此,当我尝试迭代 blob 时,它会生成异常。这个事情谁有经验?

这是一个已知问题,请参阅 Known issues with Azure Data Lake Storage Gen2

Blob Storage APIs and Azure Data Lake Gen2 APIs aren't interoperable with each other.

Blob storage APIs aren't yet available to Azure Data Lake Storage Gen2 accounts.

These APIs are disabled to prevent inadvertent data access issues that could arise because Blob Storage APIs aren't yet interoperable with Azure Data Lake Gen2 APIs.