Repository navigation
az login --allow-no-subscriptions crashes in tenant selector: 'NoneType' object has no attribute 'get' (personal MSA, no subscriptions) #34252
Copy link
Copy link
Open
Labels
Accountaz login/accountaz login/accountAuto-AssignAuto assign by botAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamThe command of the issue is owned by Azure CLI teamact-identity-squadcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
Milestone
Description
Describe the bug
az login --allow-no-subscriptions crashes in the interactive tenant/subscription selector for a personal Microsoft account (Gmail-based MSA) that has no Azure subscriptions. Plain az login reports No subscriptions found for <account>. and exits.
The traceback matches #31992 (closed), so this may be a regression or an unhandled case.
Related command
az login --allow-no-subscriptions
Errors
Retrieving tenants and subscriptions for the selection...
[Tenant and subscription selection]
The command failed with an unexpected error. Here is the traceback:
'NoneType' object has no attribute 'get'
Traceback (most recent call last):
File "...\knack/cli.py", line 233, in invoke
File "...\azure/cli/core/commands/__init__.py", line 677, in execute
File "...\azure/cli/core/commands/__init__.py", line 820, in _run_jobs_serially
File "...\azure/cli/core/commands/__init__.py", line 789, in _run_job
File "...\azure/cli/core/commands/__init__.py", line 335, in __call__
File "...\azure/cli/core/commands/command_operation.py", line 120, in handler
File "...\azure/cli/command_modules/profile/custom.py", line 238, in login
File "...\azure/cli/command_modules/profile/custom.py", line 128, in _select_and_set_active
File "...\azure/cli/command_modules/profile/_subscription_selector.py", line 69, in __call__
File "...\azure/cli/command_modules/profile/_subscription_selector.py", line 98, in _get_tenant_string
AttributeError: 'NoneType' object has no attribute 'get'
Steps to reproduce
- Use a personal Microsoft account with no Azure subscriptions.
- Run
az loginand pick the account. Result:No subscriptions found for <account>. - Run
az login --allow-no-subscriptionsand pick the same account. Result: the crash above.
Expected behavior
Login succeeds with a tenant-level account, or the CLI prints a clear message (for example that the account has no accessible tenant) instead of an unhandled exception. _get_tenant_string should handle a tenant entry with missing info.
Environment
- azure-cli 2.91.0 (azure-cli-core 2.91.0, telemetry 1.1.0), no extensions
- Windows, Windows PowerShell 5.1
Additional context
Use case: publishing a VS Code extension with vsce publish --azure-credential now that Azure DevOps PATs are being retired.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Accountaz login/accountaz login/accountAuto-AssignAuto assign by botAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamThe command of the issue is owned by Azure CLI teamact-identity-squadcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
Activity
yonzhan commentedon Oct 20, 2026
Thank you for opening this issue, we will look into it.