简体   繁体   中英

Get file sizes from Azure Storage Account using Azure CLI

Is there an AZURE CLI command that can give us the size of a file within an Azure Storage Account (stored within a container)? I just need to know the file size using Azure CLI.

I can pass the container name, or the blob name - I just need the file size.

You can use the below cmdlet to pull the list of blobs and their length in bytes inside a container in the storage account.

az storage blob list --account-name <storageAccountName> --account-key <storageAccountKey> --container-name <containerName> --query '[].{Name:name,length:properties.contentLength}' -o table

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