Azure / azure-cli

Azure Command-Line Interface
MIT License
4.01k stars 2.98k forks source link

How to list storage blobs is undiscoverable #23742

Open roy-work opened 2 years ago

roy-work commented 2 years ago

az feedback auto-generates most of the information requested below, as of CLI version 2.0.62

Related command

az storage blob --help

Describe the bug The subgroup az storage blob directory is missing from --help:

» az storage blob --help

Group
    az storage blob : Manage object storage for unstructured data (blobs).
        Please specify one of the following authentication parameters for your commands: --auth-
        mode, --account-key, --connection-string, --sas-token. You also can use corresponding
        environment variables to store your authentication credentials, e.g. AZURE_STORAGE_KEY,
        AZURE_STORAGE_CONNECTION_STRING and AZURE_STORAGE_SAS_TOKEN.

Subgroups:
    copy                : Manage blob copy operations. Use `az storage blob show` to check the
                          status of the blobs.
    immutability-policy : Manage blob immutability policy.
    incremental-copy    : Manage blob incremental copy operations.
    lease               : Manage storage blob leases.
    metadata            : Manage blob metadata.
    service-properties  : Manage storage blob service properties.

Commands:
    delete              : Mark a blob or snapshot for deletion.
    delete-batch        : Delete blobs from a blob container recursively.
    download            : Download a blob to a file path.
    download-batch      : Download blobs from a blob container recursively.
    exists              : Check for the existence of a blob in a container.
    generate-sas        : Generate a shared access signature for the blob.
    query     [Preview] : Enable users to select/project on blob or blob snapshot data by
                          providing simple query expressions.
    restore             : Restore blobs in the specified blob ranges.
    rewrite   [Preview] : Create a new Block Blob where the content of the blob is read
                          from a given URL.
    set-legal-hold      : Set blob legal hold.
    set-tier            : Set the block or page tiers on the blob.
    show                : Get the details of a blob.
    snapshot            : Creates a snapshot of the blob.
    sync      [Preview] : Sync blobs recursively to a storage blob container.
    undelete            : Restore soft deleted blob or snapshot.
    update              : Sets system properties on the blob.
    upload              : Upload a file to a storage blob.
    upload-batch        : Upload files from a local directory to a blob container.
    url                 : Create the url to access a blob.

To search AI knowledge base for examples, use: az find "az storage blob"

It does work, too:

» az storage directory list --help

Command
    az storage directory list : List directories in a share.

Arguments
[… snip]

To Reproduce Run the command.

Expected behavior Subgroups are fully documented.

Environment summary macOS

Additional context

roy-work commented 2 years ago

Oh, or is it this roundaboutness:

This command is implicitly deprecated because command group 'storage blob directory' is deprecated and will be removed in a future release. Use 'az storage fs directory' instead.

… why would I ever look for a storage blob command outside of az storage blob

(Why this isn't just as simple as az storage blob list is beyond me.)

(And additionally, it doesn't even appear to work:

» az storage blob directory list -c "$CONTAINER_NAME" -d / --account-name $ACCOUNT_NAME
[]

I know there is stuff in there, I can see it in the Portal. There's just far too much to deal with from the UI, so I need the CLI to work. -d is required, and essentially also undocumented, so I have no idea if that is the right format.)

roy-work commented 2 years ago

Additionally, this is ridiculous:

» az storage blob directory list -c [snip] -d '' --account-name [snip]
This command is implicitly deprecated because command group 'storage blob directory' is deprecated and will be removed in a future release. Use 'az storage fs directory' instead.
» az storage fs directory list --account-name [snip] -f [snip]
Command group 'storage fs' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

The old way is deprecated, the new way is not yet ready.

It'd be nice to run the simplest of operations on Azure without stumbling into umpteen different bugs.

yonzhan commented 2 years ago

@evelyn-ys for awareness