Azure Blob 存储 cli 计数

标签 azure azure-cli

我正在测试一些脚本,需要一种方法来计算容器中有多少个 blob。

我可以使用以下方法列出 blob:

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

但是我如何获得计数?

我尝试使用 --query length 但它不起作用。

最佳答案

如果您想使用 Azure CLI 获取一个容器中的 Blob 数量,请在命令中添加 --query "length(@)"

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

enter image description here

关于Azure Blob 存储 cli 计数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61725015/

相关文章:

azure - 如何通过 HTTPS 将事件发送到 Azure IoT 中心

Azure Function App - 尝试从 v2 工具发布到 v1 函数应用程序

使用 Azure CLI 将 Azure 将 VNET 链接到私有(private) DNS

azure - 创建自签名证书并将其上传到 Azure 应用服务的最简单方法

azure - 在 Windows 中使用 Azure CLI 命令与 Terraform "data source"失败

azure - 如何自动化虚拟机创建/设置过程

azure - azure blob 存储是否通过网络使用 gzip

azure - blob 与 adls gen2 ||可以通过 adls2 完成但通过 blob 存储无法完成的事情

azure - 使用 Microsoft Azure 作为计算集群

azure - 如何知道 Azure 存储帐户的容量有多大?