Anthony
Anthony

Reputation: 15

Check whether Azure Storage Blob is premium or standard

Is there an API or attribute available for CloudBlobClient or equivalent where you can verify whether the Azure Storage account is premium or standard when you have the blob uri and access key? I am currently using C#.

Here is how I am initializing the CloudBlobClient client.

var blobClient = new CloudBlobClient(
   new Uri("blobUri")), 
   new StorageCredentials("accountName", "accessKey"));

Upvotes: 1

Views: 514

Answers (1)

Michael Roberson - MSFT
Michael Roberson - MSFT

Reputation: 1621

You can find the account type using management plane operations (i.e. using the Storage Resource Provider for non-classic accounts).

Assuming you do not have access to management plane APIs, one option is to use an API that is not currently supported in premium storage (such as attempting to upload a block blob). The request will fail on premium storage. However, be cautious with this approach as it is not guaranteed to work in future versions.

Ideally, your application could be designed in such a way that you automatically scale up to the capabilities of the account without knowing in advance whether it is premium or standard.

Upvotes: 1

Related Questions