Skip to content

--auth-mode login causes crash #22845

@mdenhoedt

Description

@mdenhoedt

This is autogenerated. Please review and update as needed.

Describe the bug

Providing --auth-mode login causes crash. Not providing gives a warning suggesting you should provide it. I got the same problem on my laptop and within a Azure DevOps YAML Pipeline.

Command Name
az storage account generate-sas

Errors:

The command failed with an unexpected error. Here is the traceback:
'CredentialAdaptor' object has no attribute 'account_key'
Traceback (most recent call last):
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 231, in invoke
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 663, in execute
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 718, in _run_job
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/storage/__init__.py", line 409, in new_handler
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/storage/__init__.py", line 408, in new_handler
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 697, in _run_job
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 333, in __call__
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler
  File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/storage/operations/account.py", line 33, in generate_sas
AttributeError: 'CredentialAdaptor' object has no attribute 'account_key'

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • az storage account generate-sas --permissions lr --account-name {} --services t --resource-types sco --expiry 2022-06-13T23:57:40Z -o tsv --auth-mode login

Expected Behavior

Environment Summary

Windows-10-10.0.19042-SP0
Python 3.10.4
Installer: MSI

azure-cli 2.37.0

Extensions:
azure-devops 0.25.0
deploy-to-azure 0.2.0
dev-spaces 1.0.6

Dependencies:
msal 1.18.0b1
azure-mgmt-resource 21.1.0b1

Additional Context

Metadata

Metadata

Assignees

Labels

Auto-AssignAuto assign by botStorageaz storagecustomer-reportedIssues that are reported by GitHub users external to the Azure organization.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions