Skip to content

Latest commit

 

History

History
59 lines (41 loc) · 2.49 KB

storage-blobs-container-calculate-size-powershell.md

File metadata and controls

59 lines (41 loc) · 2.49 KB
title description services documentationcenter author manager editor ms.assetid ms.custom ms.service ms.workload ms.tgt_pltfrm ms.devlang ms.topic ms.date ms.author
Azure PowerShell Script Sample - Calculate blob container size | Microsoft Docs
Calculate the size of a container in Azure Blob storage by totaling the size of each of its blobs.
storage
na
tamram
jeconnoc
tysonn
mvc
storage
storage
na
powershell
sample
11/07/2017
tamram

Calculate the size of a Blob storage container

This script calculates the size of a container in Azure Blob storage by totaling the size of the blobs in the container.

[!INCLUDE sample-powershell-install]

[!INCLUDE quickstarts-free-trial-note]

Important

This PowerShell script provides an estimated size for the container and should not be used for billing calculations. For a script that calculates container size for billing purposes, see Calculate the size of a Blob storage container for billing purposes.

Sample script

[!code-powershellmain]

Clean up deployment

Run the following command to remove the resource group, container, and all related resources.

Remove-AzureRmResourceGroup -Name bloblisttestrg

Script explanation

This script uses the following commands to calculate the size of the Blob storage container. Each item in the table links to command-specific documentation.

Command Notes
Get-AzureRmStorageAccount Gets a specified Storage account or all of the Storage accounts in a resource group or the subscription.
Get-AzureStorageBlob Lists blobs in a container.

Next steps

For a script that calculates container size for billing purposes, see Calculate the size of a Blob storage container for billing purposes.

For more information on the Azure PowerShell module, see Azure PowerShell documentation.

Additional storage PowerShell script samples can be found in PowerShell samples for Azure Storage.