【问题标题】:How to get list of all azure blob containers of all regions and how to get Region of a Azure blob container如何获取所有区域的所有 azure blob 容器的列表以及如何获取 Azure blob 容器的区域
【发布时间】:2020-10-09 20:29:57
【问题描述】:

我需要帮助解决两个使用 java sdk 的问题:

  1. 如何获取所有区域中的所有 Azure blob 容器及其区域名称/代码的列表?

是否需要遍历所有存储帐户才能获取 Blob 容器列表?

  1. 如何从 blobServiceClientBlobContainerClientBlobContainerItem 获取 Azure 帐户的区域代码?

据我所知,azure 没有容器区域,但区域与 Storage account 相关联(如果我错了,请纠正我)。 如何从blobServiceClient 获取storage account 的区域。

我可以使用

获取帐户信息
blobServiceClient.getAccountInfo()

但它没有任何区域信息。

注意

我有storage account key,我用它生成connection string,我用它得到blobServiceClient,但无法获取该存储帐户的区域。

【问题讨论】:

    标签: azure azure-storage azure-java-sdk


    【解决方案1】:

    对于存储帐户资源(而不是存储帐户下的容器、blob 等)的信息/操作,您可以使用管理客户端,如 sample

    相关代码here。基本上列出所有存储帐户(按订阅或按资源组),然后检查其 region() 方法。

    【讨论】:

      猜你喜欢
      • 2015-11-10
      • 2021-05-06
      • 2014-09-15
      • 2020-09-03
      • 2022-01-15
      • 2017-07-27
      • 2015-12-07
      • 2019-01-18
      • 1970-01-01
      相关资源
      最近更新 更多