1
votes

Is there a way to get properties of a storage account, specifically the kind of account - GPv1, GPv2 or blob storage, through an API in Storage Services?

I came across https://msdn.microsoft.com/en-us/library/azure/ee460802.aspx but if possible, I would like to re-use the SharedKey authentication I use for the Blob Service APIs.

In this page, https://docs.microsoft.com/en-us/rest/api/storageservices/ I found this:

"All access to storage services takes place through the storage account. The storage account is the highest level of the namespace for accessing each of the fundamental services. It is also the basis for authentication.+ The REST APIs for storage services expose the storage account as a resource."

How would I get properties of that resource? I played around with setting the restype to storage account, similar to "container" and "table", but could not access it.

1
What do you mean, when you say you want to re-use SharedKey authentication? Storage only has one main type of authentication (namespace plus either primary or secondary key), along with optional SAS. So I'm not sure exactly what you're asking for, especially since the link you provided is the REST call for getting a storage account's properties. Please edit to be clearer.David Makogon

1 Answers

2
votes

When it comes to managing storage accounts, there are two REST APIs:

  1. Storage Service REST API: This API is used to manage the data in the storage accounts. This makes use of account name and access key (also known as storage account key). You can find more details about this API here: https://docs.microsoft.com/en-us/rest/api/storageservices/.
  2. Storage Resource Provider (SRP) REST API: This API is used to manage storage accounts. You can use this API to create, update, delete storage accounts, regenerate account keys and get information about the storage account themselves. This makes use of Azure AD for authentication and authorization. You can find more details about this API here: https://docs.microsoft.com/en-us/rest/api/storagerp/.

Now coming to your question, you can't really use Storage Service REST API to find information about the type of storage account. You would need to use Storage Resource Provider API to find this information. In particular you will be consuming Get Properties SRP API to find this information.