Skip to content

[account] az login fails #9973

Open
Open

Description

Source: Azure/azure-cli#32371 (by Chris Segura (@cnsegura))
Affected extension: account (src/account/)


<<UNTRUSTED:issue-32371>>

Issue #32371 (by Chris Segura (@cnsegura))

Title

az login fails

Body

Describe the bug

I am attempting to use the az cli command "az login" to login to Azure from my corp-managed device and get the error added below.

This is on a corp managed device, which has full access to all internal services, shows as connected on the CompanyPortal etc.

I have updated to the latest cli and cleared the account info (via az account clear) and set the core.enable_broker_on_windows = true

with no change in behavior.

Related command

no related commands - just az login

Errors

az login
Select the account you want to log in with. For more information on login with Azure CLI, see https://go.microsoft.com/fwlink/?linkid=2271136

Retrieving tenants and subscriptions for the selection...
The command failed with an unexpected error. Here is the traceback:
argument of type 'NoneType' is not iterable

Issue script & Debug output

NA

Expected behavior

I can loginto Azure and view resources, subscriptions etc

Environment Summary

azure-cli 2.78.0

core 2.78.0
telemetry 1.1.0

Dependencies:
msal 1.34.0b1
azure-mgmt-resource 23.3.0

Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Config directory 'C:\Users\ADMIN_chrisseg.azure'
Extensions directory 'C:\Users\ADMIN_chrisseg.azure\cliextensions'

Python (Windows) 3.13.7 (tags/v3.13.7:bcee1c3, Aug 14 2025, 14:06:58) [MSC v.1944 32 bit (Intel)]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

Additional context

No response

Comments

Comment by Yong Zhang (@yonzhan)

Thank you for opening this issue, we will look into it.

Comment by @github-actions[bot]

Here are some similar issues that might help you. Please check if they can solve your problem.

  • #17515
  • #17514

Possible solution (Extracted from existing issue, might be incorrect; please verify carefully)

Solution 1:

Known issue. See Azure/azure-cli#17509 for details and quickfix.

Reference:

Solution 2:

This is caused by an ongoing ARM service incident. Please see #17509.

Reference:

Solution 3:

An ugly workaround without the patch #17509 is to use the hybrid profile:
'''
az cloud set --name AzureCloud --profile 2020-09-01-hybrid
az login
'''
As pointed out: setting --profile 2020-09-01-hybrid will cause other failures (like for az aks) because 2020-09-01-hybrid has a reduced command set compared to latest.

Reference:

Powered by issue-sentinel

Comment by Jiashuo Li (@jiasli)

According to the internal email, the error happens in MSAL’s msal/broker.py file, at Line 59, in _convert_error:

https://github.com/AzureAD/microsoft-authentication-library-for-python/blob/f0dec594f18b76afb422396e710b0834cbac352b/msal/broker.py#L59

''' py
"AADSTS50011" in context # In WAM, this could happen on both interactive and silent flows
'''

This issue should be investigated by MSAL.

Comment by @microsoft-github-policy-service[bot]

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc Joseph Chan (@josephkwchan), Jenny Hunter (@jennyhunter-msft).

Comment by Dharshan BJ (@DharshanBJ)

Jiashuo Li (@jiasli), Yong Zhang (@yonzhan) Based on the screenshot shared by Chris in the email thread regarding this issue, error.get_context() in convert_error seems to be returning None, causing a TypeError: argument of type 'NoneType' is not iterable at line 59-60 in msal/broker.py. This is likely an error-handling bug in broker.py which is masking the actual underlying broker error.

The MSAL Python logs shared in the email thread shows error tag 7q6ch, which maps to an Unexpected WAM provider error. The system error code 3489661028 corresponds to STATUS_NO_SUCH_USER - "The specified account does not exist."

We need WAM logs to further investigate this.

Comment by Dharshan BJ (@DharshanBJ)

Jiashuo Li (@jiasli) / Yong Zhang (@yonzhan) , is the user still encountering this issue? Do we need to track this?

Comment by jennguye

I have the same issue...
<<END:issue-32371>>

Activity

  1. yonzhan commented on Jun 22, 2026

    @yonzhan
    Collaborator

    Thank you for opening this issue, we will look into it.

  2. azclibot commented on Jun 22, 2026

    @azclibot
    CollaboratorAuthor

    This is a tracker for Azure/azure-cli#32371.

    Bug summary: az login fails on Windows with argument of type 'NoneType' is not iterable when core.enable_broker_on_windows = true is set on a corp-managed device.

    Environment:

    • azure-cli 2.78.0
    • Python 3.13.7 (Windows, 32-bit)
    • MSAL 1.34.0b1

    Failing command: az login

    Error: argument of type 'NoneType' is not iterable — occurs during tenant/subscription retrieval after account selection.

    Context: The error originates in MSAL's broker.py (noted by jiasli in the original issue). The fix should handle the NoneType gracefully in the account extension's login/auth flow, or ensure the MSAL broker error is caught and a meaningful error message is shown to the user.

    Please investigate the account extension for the broker-related login path on Windows and add appropriate null-checks or error handling for when the MSAL broker returns None unexpectedly.


    Posted by agent-assist (autonomous bug-fix pipeline).

  3. added
    Service AttentionThis issue is responsible by Azure service team.
    Azure CLI TeamThe command of the issue is owned by Azure CLI team
    questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
    on Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

AKSAccountAuto-AssignAuto assign by botService AttentionThis issue is responsible by Azure service team.SubscriptionquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions