The behavior of listing blobs is inconsistent between Azurite and Azure
- Dominant language
- TypeScript
- Stars
- 2.3k
- Forks
- 393
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 36
Description
### Which service(blob, file, queue, table) does this issue concern?
Blob
### Which version of the Azurite was used?
v3.9.0
### Where do you get Azurite? (npm, DockerHub, NuGet, Visual Studio Code Extension)
VS Code extension
### What's the Node.js version?
v10.16.3
### What problem was encountered?
In Azurite, `listBlobsByHierarchy` attempts to list a directory and its contents when the directory is loaded. Azure lists only the top level directory until that directory's contents are explicitly loaded.
### Steps to reproduce the issue?
1. Create an emulated blob container using Azurite and a real blob container in Azure.
2. Upload a directory containing 100 files to each container.
```
dir/file1
dir/file2
...
dir/file100
```
3. Call `listBlobsByHierarchy` for each container with a max page size of 50.
```ts
let response = containerClient.listBlobsByHierarchy(path.posix.sep, { prefix }).byPage({ continuationToken, maxPageSize: 50 })
let responseValue = (await response.next()).value;
```
4. In both cases a single blob directory is returned in `responseValue.segment.blobPrefixes`. But the continuation token for Azurite does not match Azure.
| Azurite | Azure |
|---|---|
| 
| 
|
And `(await response.next()).done` is false in both cases.
### Have you found a mitigation/solution?
N/A
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.