Reputation: 1791
I need help with two questions using java sdk:
- 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?
- How to get region Code of an azure account from a
blobServiceClient
orBlobContainerClient
orBlobContainerItem
?
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
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