Azure / Azure/azure-rest-api-specs
[BUG] List Blobs API would need to provide capability of showing the blobs in soft deleted directory
- Dominant language
- TypeSpec
- Stars
- 3.1k
- Forks
- 5.9k
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 444
Description
### API Spec link
https://learn.microsoft.com/en-us/rest/api/storageservices/list-blobs?view=rest-storageservices-datalakestoragegen2-2019-12-12&tabs=microsoft-entra-id
### API Spec version
2022-11-02
### Describe the bug
I have soft-delete enabled for both blobs and containers on my ADLS Gen2 account. Below is the folder structure in my container:
container
--dir1
----dir2
------dir3
--------blob1
--------blob2
--------blob3
If I delete dir3 and try to list its contents, the ListBlob API does not list blob1, blob2, or blob3, even though I include the metadata and deleted query parameters in my API call. This issue causes the blob inventory to display incorrect capacity details, as documented in the known [limitations section](https://learn.microsoft.com/en-us/azure/storage/blobs/blob-inventory#reports-might-exclude-soft-deleted-blobs-in-accounts-that-have-a-hierarchical-namespace).
This problem affects not only the blob inventory but also all other client tools, which cannot calculate capacity correctly due to the List Blobs API limitation.
The Python SDK team closed my previously reported issue, stating that the ListBlobs API needs to be fixed for their SDK to function as expected.
https://github.com/Azure/azure-sdk-for-python/issues/35646
### Expected behavior
ListBlob API should be able to list blob1, blob2 and blob3 even though I deleted the dir3.
### Actual behavior
ListBlob API isn't listing the soft-deleted blob under dir3.
### Reproduction Steps
To create a directory structure in your ADLS Gen2 storage account, follow these steps:
1. Create the following directory structure:
container
--dir1
----dir2
------dir3
--------blob1
--------blob2
--------blob3
2. Enable soft-delete for blobs.
3. Delete dir3.
4. Use the ListBlobs API call to list the blobs under dir3.
### Environment
_No response_
Contributor guide
Research direction
Start with the linked List Blobs API specification for version 2022-11-02 and review how the metadata, deleted, and hierarchical namespace cases are described. Compare that contract with the reproduced deleted-directory scenario; done requires an agreed API or specification change that allows blob1, blob2, and blob3 to be listed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- api, cloud
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100