0

I need help with two questions using java sdk:

  1. How to get a list of all Azure blob containers in all regions with their region name/ code?

Do I need to loop over all the Storage accounts to get a list of Blob containers?

  1. How to get region Code of an azure account from a blobServiceClient or BlobContainerClient or BlobContainerItem?

As far as I know azure does not have regions of a container but regions are associated with Storage account (correct me if I am wrong). How to get Region of a storage account from blobServiceClient.

I can get account Info using

blobServiceClient.getAccountInfo()

but it does not have any region information in it.

Note

I have storage account key with which I generate connection string with which I get the blobServiceClient, but there is no way of getting region of that storage account.

CodeTalker
  • 1,683
  • 2
  • 21
  • 31

1 Answers1

1

For infomation/operation on storage account resource (instead of container, blob etc. under storage account), you could use a management client, as sample.

Related code here. Basically list all storage accounts (by subscription or by resource group), then check its region() method.

weidongxu
  • 303
  • 1
  • 7