Skip to content

delete-batch ignores --query option #21568

@j3ffrw

Description

@j3ffrw

Describe the bug

According to documentation delete-batch --query is supported as part of Global parameter https://docs.microsoft.com/en-us/cli/azure/storage/blob?view=azure-cli-latest#az-storage-blob-delete-batch

Command Name
az storage blob list
az storage delete-batch

Errors:

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • az storage blob list --include m --prefix "myBlobPrefix*" --output table --num-results "*" --query "[?metadata.myKey=='myVal']"
  • az storage delete-batch --dry-run --pattern "myBlobPrefix*" --query "[?metadata.myKey=='myVal']"

Expected Behavior

az storage delete-batch --dry-run --query should only show file that match the "--query"

Environment Summary

Linux-5.4.0-54-generic-x86_64-with-debian-bullseye-sid
Python 3.6.10
Installer: DEB

azure-cli 2.8.0

Additional Context

This is related to this #15734 though OP asked for delete-batch, answer was for download-batch but I assume its a mistype.
Basically we want to delete-batch a blob that match the query, in my case a metadata.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions