azure-cli: az storage entity merge outputs invalid warning message
Describe the bug
Command Name
az storage entity merge
Errors:
az: error: unrecognized arguments: --auth-mode login
To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.
az storage entity merge --entity PartitionKey=foo RowKey=bar SomethingElse=whatever --table-name MyTable --account-name MyAccount
Note warning that is output:
No connection string, account key or sas token found, we will query account keys for your storage account. Please try to use --auth-mode login or provide one of the following parameters: connection string, account key or sas token for your storage account.
Try to follow suggestion in warning message:
az storage entity merge --auth-mode login --entity PartitionKey=foo RowKey=bar SomethingElse=whatever --table-name MyTable --account-name MyAccount
Expected Behavior
Either the warning should not be emitted, or the auth-mode parameter should work.
Environment Summary
macOS-10.15.2-x86_64-i386-64bit
Python 3.8.1
Shell: bash
azure-cli 2.0.81
Additional Context
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 2
- Comments: 17 (7 by maintainers)
Hi @Juliehzl - This issue should probably be reopened as the problem that was mentioned has not been resolved (unless I’m missing an update). I only ended up finding this issue because of the mentioned error message - only to find out that --auth-mode login is not supported. Having an accurate error message would have saved this investigative time for myself and others.
Outputting informational message to stderr is in violation of decades of expected behavior of stderr. Informational messages typically belong in stdout.
If you are not sure how to fix this or authentication is upstream provider out of your control: A wrapper function that will try/catch each auth method and only outputs to stderr if none of the authentication methods were successful could handle this for you.
--only-show-errors
implies only showing errors, no informational output. I (and everyone else) can add this but it is a backwards workaround for a problem that shouldn’t exist. This flag really shouldn’t exist.