简体   繁体   English

azure blob 存储 cli 计数

[英]azure blob storage cli count

I'm testing some scripts and need a way to count how many blobs there are in a container.我正在测试一些脚本,需要一种方法来计算容器中有多少 blob。

I can list the blobs using:我可以使用以下命令列出 blob:

az storage blob list --container-name "xxx" --account-key "xxx" --account-name "xxx" -o table

But how do I get a count?但是我如何得到一个计数?

I tried using --query length but it doesn't work.我尝试使用 --query length 但它不起作用。

If you want to get the amount of blob in one container with Azure CLI, please add --query "length(@)" in your command如果您想使用 Azure CLI 获取一个容器中的 blob 数量,请在命令中添加--query "length(@)"

az storage blob list -c "xxx" --account-key "xxx" --account-name "xxx" --query "length(@)" -o table

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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