Next Marker Missing From az storage blob list Response Object
See original GitHub issue
az feedback
auto-generates most of the information requested below, as of CLI version 2.0.63
Describe the bug
The command az storage blob list
produces the next token in stderr, instead of including it in the response object. The response object is an array, which means it can’t have a marker, however, something should be done about this because that makes this a nightmare to write automation against.
To Reproduce
- Create a storage account with a container and two blobs.
az storage blob list --account-name <account> --container-name <container> --num-results 1
Expected behavior I would like to be able to write automation against any command in the az CLI easily. For example, I would expect either the following PowerShell or similar to return all blobs in a storage account container:
$next_token = ""
do {
$response = & az storage blob list --account-name <account> --container-name <container> --num- results 1 | ConvertFrom-Json
$next_token = $response.next_marker
$blobs += $response.blobs
} while ($next_token -ne $null)
$blobs
Environment summary OS: Windows 10 Shell: PowerShell 7.0.0 Installer: MSI az --version:
azure-cli 2.6.0
command-modules-nspkg 2.0.3
core 2.6.0
nspkg 3.0.4
telemetry 1.0.4
Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\alexei.barnes\.azure\cliextensions'
Python (Windows) 3.6.6 (v3.6.6:4cf1f54eb7, Jun 27 2018, 02:47:15) [MSC v.1900 32 bit (Intel)]
Legal docs and information: aka.ms/AzureCliLegal
Your CLI is up-to-date.
Please let us know how we are doing: https://aka.ms/clihats
and let us know if you're interested in trying out our newest features: https://aka.ms/CLIUXstudy
Additional context The help docs on this command specifically call out reading “next_marker”:
--marker : An opaque continuation token. This value can be retrieved from
the next_marker field of a previous generator object if
num_results was specified and that generator has finished
enumerating results. If specified, this generator will begin
returning results from the point where the previous generator
stopped.
Issue Analytics
- State:
- Created 3 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
az storage blob | Microsoft Learn
List blobs across all containers whose tags match a given search expression. az storage blob generate-sas. Generate a shared access signature for the...
Read more >how to grab next marker (next_marker) in azure cli command ...
As a workaround, you can use this azure cli command: az storage blob list(Most of the azure blob storage cli commands are also...
Read more >azure-cli-storage 2.4.3 - PyPI
Use –num-results * for original behavior of returning all results. storage blob/file/container/share list - log marker for next page to STDERR and expose...
Read more >GetObject - Amazon Simple Storage Service
If the current version of the object is a delete marker, Amazon S3 behaves as if the object was deleted and includes x-amz-delete-marker:...
Read more >HTTP headers and query string parameters for XML API
When serving via XML, Cloud Storage respects the cache-control of the object as set by its metadata. Content-Disposition. A request and response header...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @Alexei-B, thanks for your feedback.
To not break existing users’ scripts, we are thinking that adding one additional argument to represent that users want to include nextMarker in the response. If you still have any concern, feel free to let me know.
I see. We will plan for the feature soon.