question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

  1. Create a storage account with a container and two blobs.
  2. 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:closed
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
Juliehzlcommented, Jun 22, 2020

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.

0reactions
Juliehzlcommented, Feb 10, 2021

@Juliehzl Zunli Hu FTE could you please also add this parameter –show-next-marker for ADLS Gen2, for this command az storage fs file list?

I see. We will plan for the feature soon.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found