简体   繁体   中英

How to detect Azure Storage type using SDK?

I need to be able to detect the type of storage that a certain account offers. For example, if a user gives me their Storage Account and Key, I need to be able to detect whether or not it is a Premium LRS type of storage. I have looked at the CloudStorageAccount class without any luck. Does anyone know how I can detect this programatically?

You need to use Azure Management API's for this. Initialize StorageManagementClient object and "Get" a storage account from it. storageAccount.Properties.AccountType contains if the account is "Premium" or other

Storage Nuget package for Management API is: Microsoft.WindowsAzure.Management.Storage (classic) or Microsoft.Azure.Management.Storage (v2/ARM)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM