Skip to content

Validation error on account name & account key parameters #784

Description

Set account name but not key.

$ export AZURE_STORAGE_ACCOUNT=mystorageaccount

After running $ az storage blob list -c vhds, I expect an error saying storage key not specified or similar but instead, I get the following.

$ az storage blob list -c vhds
usage: az storage blob list [-h] [--output {json,tsv,list,table,jsonc}]
                            [--verbose] [--debug] [--query JMESPATH]
                            --container-name CONTAINER_NAME
                            [--timeout TIMEOUT] [--account-name ACCOUNT_NAME]
                            [--marker MARKER] [--sas-token SAS_TOKEN]
                            [--connection-string CONNECTION_STRING]
                            [--num-results NUM_RESULTS] [--include INCLUDE]
                            [--delimiter DELIMITER]
                            [--account-key ACCOUNT_KEY] [--prefix PREFIX]
az storage blob list: error: 'NoneType' object has no attribute 'id'

The bug is in _validators.py, acc_id = next((x for x in scf.storage_accounts.list() if x.name == n.account_name), None).id.

If n.account_name isn't in the storage accounts list, the iterator will return None and so 'NoneType' object has no attribute 'id'

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Storageaz storagebugThis issue requires a change to an existing behavior in the product in order to be resolved.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions