Azure:如何知道订阅级别的总存储量

时间:2017-10-06 22:24:04

标签: azure azure-storage-blobs

我正在寻找一种方法来计算订阅级别的总存储空间(不是存储帐户级别)

所有块类型的存储(按地区划分?)

1 个答案:

答案 0 :(得分:0)

  

所有块类型的存储(按地区划分?)

如果您希望获得订阅的Azure(ARM)存储帐户的总存储空间,则可以先list all the storage accounts under the subscription

GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts?api-version={api-version}

然后,您可以按locationlist all containers under the specified account对存储帐户进行分组。

GET https://myaccount.blob.core.windows.net/?comp=list

获得容器后,您可以list blobs under the specified container计算块blob的总大小(基于BlobType)。

GET https://myaccount.blob.core.windows.net/mycontainer?restype=container&comp=list

<强> 更新

我们可以通过检查Azure门户上的容器属性,在存储帐户容器级别获取总块blob大小。

enter image description here

阻止blob计数和大小

enter image description here