CodeTalker
CodeTalker

Reputation: 1791

How to get list of all azure blob containers of all regions and how to get Region of a Azure blob container

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.

Upvotes: 0

Views: 716

Answers (1)

weidongxu
weidongxu

Reputation: 318

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.

Upvotes: 1

Related Questions