Azure / Azure/azure-cli

az storage fs directory delete using blob-endpoint do not behave the same as using account-name

Open
#32,267 1 comment 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 2h
Merged PRs (30d)
60

Description

### Describe the bug

Hierarchical namespace is enabled.

I have the following structure:
`az storage blob list -c '$web' -o tsv --query "[].name" --account-name azjonathanteste --auth-mode login
assets
assets/config
assets/config/assets.js
index.html
nivel0.js
unstable
unstable/assets
unstable/assets/nivel2.js
unstable/nivel1.js
unstable/sr
unstable/sr/nivel2.js
unstable/sr/other
unstable/sr/other/dir
unstable/sr/other/dir/nivel4.js`

when I run the az storage fs directory delete with account-name it works fine:

`az storage fs directory delete --name 'unstable' -f '$web' --account-name azjonathanteste -y --auth-mode login

{
"continuation": null,
"date": "2025-10-15T19:30:08+00:00",
"deletion_id": "134050302090974368",
"request_id": "db23bc76-a01f-0064-470a-3e1f16000000",
"version": "2021-08-06"
}`

If I run using --blob-endpoint, it does not. It says the dir is not empty:

`az storage fs directory delete --name 'unstable' -f '$web' --blob-endpoint https://azjonathanteste.blob.core.windows.net -y --auth-mode login

This operation is not permitted on a non-empty directory.
RequestId:97f14d92-001e-0020-3509-3e9529000000
Time:2025-10-15T19:25:39.1511180Z
ErrorCode:DirectoryIsNotEmpty`

### Related command

az storage fs directory delete --name 'unstable' -f '$web' --account-name azjonathanteste -y --auth-mode login
az storage fs directory delete --name 'unstable' -f '$web' --blob-endpoint https://azjonathanteste.blob.core.windows.net -y --auth-mode login

### Errors

This operation is not permitted on a non-empty directory.
RequestId:97f14d92-001e-0020-3509-3e9529000000
Time:2025-10-15T19:25:39.1511180Z
ErrorCode:DirectoryIsNotEmpty

### Issue script & Debug output

Provided above.

### Expected behavior

I expect the commands to behave the same. Delete recursively a directory.

### Environment Summary

azure-cli 2.78.0

core 2.78.0
telemetry 1.1.0

Dependencies:
msal 1.34.0b1
azure-mgmt-resource 23.3.0

Python location '/opt/az/bin/python3'
Config directory '/home/jonatiao/.azure'
Extensions directory '/home/jonatiao/.azure/cliextensions'

Python (Linux) 3.13.7 (main, Oct 9 2025, 05:49:51) [GCC 11.4.0]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

### Additional context

_No response_

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.