Azure / Azure/azure-cli

Can't exclude numeric named directory from batch delete

Open
#27,809 5 comments 0 reactions 2 assignees Claimed by @calvinhzy View on GitHub
act-codegen-extensibility-squad Auto-Assign Azure CLI Team customer-reported question Storage
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 10h
Merged PRs (30d)
64

Description

### Describe the bug

When Im trying to batch delete all content except single directory it doesnt work with numeric values. It doest work with letters, ie.

az storage blob delete-batch --dryrun --source blo --account-name bloaccount --pattern '[!abc]*'

This one doesnt work:

az storage blob delete-batch --dryrun --source blo --account-name bloaccount --pattern '[!123]*'

### Related command

az storage blob delete-batch --dryrun --source blo --account-name bloaccount --pattern '[!123]*'

### Errors

No errors

### Issue script & Debug output

pattern [!123]*
container bla
total 0
operations

### Expected behavior

Should list all files excluding directory 123

### Environment Summary

azure-cli 2.53.1

core 2.53.1
telemetry 1.1.0

Extensions:
ai-examples 0.2.5
aks-preview 0.5.149
ml 2.21.1
ssh 2.0.2

Dependencies:
msal 1.24.0b2
azure-mgmt-resource 23.1.0b2

Python location '/usr/bin/python3.9'
Extensions directory '/home/xxx/.azure/cliextensions'
Extensions system directory '/usr/lib/python3.9/site-packages/azure-cli-extensions'

Python (Linux) 3.9.14 (main, Oct 12 2023, 19:48:32)
[GCC 11.2.0]

Legal docs and information: aka.ms/AzureCliLegal

### Additional context

All directories have numeric values, ie. 1698355393591

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.