Skip to content

Login Error #33744

Description

@tebby455

Describe the bug

I tried to use az login as normal with method use device code. I get the error below when I try to login. Then I trace that I got request blocked. Details below

Related command

az login
az login --tenant [tenantID] --allow-no-subscriptions --use-device-code --debug 2>debug.txt

Errors

az login

To sign in, use a web browser to open the page https://login.microsoft.com/device and enter the code XXXXX to authenticate.

Retrieving tenants and subscriptions for the selection...
JSON is invalid: Expecting value: line 1 column 1 (char 0)

Issue script & Debug output

az login

DEBUG: urllib3.util.retry: Converted retries value: 1 -> Retry(total=1, connect=None, read=None, redirect=None, status=None)
DEBUG: msal.application: Broker enabled? None
DEBUG: cli.azure.cli.core.auth.credential_adaptor: CredentialAdaptor.get_token_info: scopes=('https://management.core.windows.net//.default',), options={}
DEBUG: cli.azure.cli.core.auth.msal_credentials: UserCredential.acquire_token: scopes=['https://management.core.windows.net//.default'], claims_challenge=None, kwargs={}
DEBUG: msal.application: Cache hit an AT
DEBUG: msal.telemetry: Generate or reuse correlation_id: bd13ec46-2643-4c97-992b-23867368e566
DEBUG: cli.azure.cli.core.sdk.policies: Request URL: 'https://management.azure.com/tenants?api-version=2022-12-01'
DEBUG: cli.azure.cli.core.sdk.policies: Request method: 'GET'
DEBUG: cli.azure.cli.core.sdk.policies: Request headers:
DEBUG: cli.azure.cli.core.sdk.policies:     'Accept': 'application/json'
DEBUG: cli.azure.cli.core.sdk.policies:     'x-ms-client-request-id': '780dcfe4-8197-11f1-bbf6-c9a84cc32554'
DEBUG: cli.azure.cli.core.sdk.policies:     'CommandName': 'login'
DEBUG: cli.azure.cli.core.sdk.policies:     'ParameterSetName': '--debug'
DEBUG: cli.azure.cli.core.sdk.policies:     'User-Agent': 'AZURECLI/2.88.0 (DEB) azsdk-python-core/1.39.0 Python/3.14.5 (Linux-6.8.0-1052-azure-x86_64-with-glibc2.35)'
DEBUG: cli.azure.cli.core.sdk.policies:     'Authorization': '*****'
DEBUG: cli.azure.cli.core.sdk.policies: Request body:
DEBUG: cli.azure.cli.core.sdk.policies: This request has no body
DEBUG: urllib3.connectionpool: Starting new HTTPS connection (1): management.azure.com:443
DEBUG: urllib3.connectionpool: https://management.azure.com:443 "GET /tenants?api-version=2022-12-01 HTTP/1.1" 403 None
DEBUG: cli.azure.cli.core.sdk.policies: Response status: 403
DEBUG: cli.azure.cli.core.sdk.policies: Response headers:
DEBUG: cli.azure.cli.core.sdk.policies:     'X-MSEdge-Ref': 'Ref A: 2A5E6C6E03194035BEB9E86CF39D68AE Ref B: MWH011020807023 Ref C: 2026-07-17T04:25:34Z'
DEBUG: cli.azure.cli.core.sdk.policies:     'Date': 'Fri, 17 Jul 2026 04:25:34 GMT'
DEBUG: cli.azure.cli.core.sdk.policies:     'Connection': 'close'
DEBUG: cli.azure.cli.core.sdk.policies: Response content:
DEBUG: cli.azure.cli.core.sdk.policies: <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'><html xmlns='http://www.w3.org/1999/xhtml'><head><meta content='text/html; charset=utf-8' http-equiv='content-type'/><style type='text/css'>body { font-family:Arial; margin-left:40px; }img  { border:0 none; }#content { margin-left: auto; margin-right: auto }#message h2 { font-size: 20px; font-weight: normal; color: #000000; margin: 34px 0px 0px 0px }#message p  { font-size: 13px; color: #000000; margin: 7px 0px 0px 0px }#errorref { font-size: 11px; color: #737373; margin-top: 41px }</style><title>Microsoft</title></head><body><div id='content'><div id='message'><h2>The request is blocked.</h2></div><div id='errorref'><span>Ref A: 2A5E6C6E03194035BEB9E86CF39D68AE Ref B: MWH011020807023 Ref C: 2026-07-17T04:25:34Z</span></div></div></body></html>
DEBUG: cli.azure.cli.core.azclierror: Traceback (most recent call last):
  File "/opt/az/lib/python3.14/site-packages/azure/core/pipeline/policies/_universal.py", line 618, in deserialize_from_text
    return json.loads(data_as_str)
           ~~~~~~~~~~^^^^^^^^^^^^^
  File "/opt/az/lib/python3.14/json/__init__.py", line 352, in loads
    return _default_decoder.decode(s)
           ~~~~~~~~~~~~~~~~~~~~~~~^^^
  File "/opt/az/lib/python3.14/json/decoder.py", line 345, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.14/json/decoder.py", line 363, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/az/lib/python3.14/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
  File "/opt/az/lib/python3.14/site-packages/azure/cli/core/commands/__init__.py", line 677, in execute
    raise ex
  File "/opt/az/lib/python3.14/site-packages/azure/cli/core/commands/__init__.py", line 820, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
                   ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.14/site-packages/azure/cli/core/commands/__init__.py", line 789, in _run_job
    result = cmd_copy(params)
  File "/opt/az/lib/python3.14/site-packages/azure/cli/core/commands/__init__.py", line 335, in __call__
    return self.handler(*args, **kwargs)
           ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.14/site-packages/azure/cli/core/commands/command_operation.py", line 120, in handler
    return op(**command_args)
  File "/opt/az/lib/python3.14/site-packages/azure/cli/command_modules/profile/custom.py", line 215, in login
    subscriptions = profile.login(
        interactive,
    ...<11 lines>...
        subscription=subscription
    )
  File "/opt/az/lib/python3.14/site-packages/azure/cli/core/_profile.py", line 216, in login
    subscriptions = subscription_finder.find_using_common_tenant(username, credential)
  File "/opt/az/lib/python3.14/site-packages/azure/cli/core/_profile.py", line 831, in find_using_common_tenant
    for t in tenants:
             ^^^^^^^
  File "/opt/az/lib/python3.14/site-packages/azure/core/paging.py", line 136, in __next__
    return next(self._page_iterator)
  File "/opt/az/lib/python3.14/site-packages/azure/core/paging.py", line 82, in __next__
    self._response = self._get_next(self.continuation_token)
                     ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.14/site-packages/azure/mgmt/resource/subscriptions/v2022_12_01/operations/_operations.py", line 720, in get_next
    pipeline_response: PipelineResponse = self._client._pipeline.run(  # pylint: disable=protected-access
                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        _request, stream=_stream, **kwargs
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/opt/az/lib/python3.14/site-packages/azure/core/pipeline/_base.py", line 242, in run
    return first_node.send(pipeline_request)
           ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.14/site-packages/azure/core/pipeline/_base.py", line 98, in send
    response = self.next.send(request)
  File "/opt/az/lib/python3.14/site-packages/azure/core/pipeline/_base.py", line 98, in send
    response = self.next.send(request)
  File "/opt/az/lib/python3.14/site-packages/azure/core/pipeline/_base.py", line 98, in send
    response = self.next.send(request)
  [Previous line repeated 1 more time]
  File "/opt/az/lib/python3.14/site-packages/azure/core/pipeline/_base.py", line 102, in send
    _await_result(self._policy.on_response, request, response)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.14/site-packages/azure/core/pipeline/_tools.py", line 49, in await_result
    result = func(*args, **kwargs)
  File "/opt/az/lib/python3.14/site-packages/azure/core/pipeline/policies/_universal.py", line 728, in on_response
    response.context[self.CONTEXT_NAME] = self.deserialize_from_http_generics(
                                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        response.http_response, response_encoding
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/opt/az/lib/python3.14/site-packages/azure/core/pipeline/policies/_universal.py", line 690, in deserialize_from_http_generics
    return cls.deserialize_from_text(response.text(encoding), mime_type, response=response)
           ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/az/lib/python3.14/site-packages/azure/core/pipeline/policies/_universal.py", line 620, in deserialize_from_text
    raise DecodeError(
    ...<3 lines>...
    ) from err
azure.core.exceptions.DecodeError: JSON is invalid: Expecting value: line 1 column 1 (char 0)
Content: <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'><html xmlns='http://www.w3.org/1999/xhtml'><head><meta content='text/html; charset=utf-8' http-equiv='content-type'/><style type='text/css'>body { font-family:Arial; margin-left:40px; }img  { border:0 none; }#content { margin-left: auto; margin-right: auto }#message h2 { font-size: 20px; font-weight: normal; color: #000000; margin: 34px 0px 0px 0px }#message p  { font-size: 13px; color: #000000; margin: 7px 0px 0px 0px }#errorref { font-size: 11px; color: #737373; margin-top: 41px }</style><title>Microsoft</title></head><body><div id='content'><div id='message'><h2>The request is blocked.</h2></div><div id='errorref'><span>Ref A: 2A5E6C6E03194035BEB9E86CF39D68AE Ref B: MWH011020807023 Ref C: 2026-07-17T04:25:34Z</span></div></div></body></html>

ERROR: cli.azure.cli.core.azclierror: JSON is invalid: Expecting value: line 1 column 1 (char 0)
ERROR: az_command_data_logger: JSON is invalid: Expecting value: line 1 column 1 (char 0)
DEBUG: cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x75750de68300>]
INFO: az_command_data_logger: exit code: 1
INFO: cli.__main__: Command ran in 36.980 seconds (init: 0.037, invoke: 36.943)
INFO: telemetry.main: Begin splitting cli events and extra events, total events: 1
INFO: telemetry.main: Finish splitting cli events and extra events, cli events: 1
INFO: telemetry.save: Save telemetry record of length 3963 in cache file under /home/azureuser/.azure/telemetry/20260717042534909
INFO: telemetry.main: Begin creating telemetry upload process.
INFO: telemetry.process: Creating upload process: "/opt/az/bin/python3 /opt/az/lib/python3.14/site-packages/azure/cli/telemetry/__init__.py /home/azureuser/.azure /home/azureuser/.azure/telemetry/20260717042534909"
INFO: telemetry.process: Return from creating process 1962
INFO: telemetry.main: Finish creating telemetry upload process.

Expected behavior

Login successfully

Environment Summary

azure-cli 2.88.0

core 2.88.0
telemetry 1.1.0

Dependencies:
msal 1.36.0
azure-mgmt-resource 24.0.0

Python location '/opt/az/bin/python3'
Config directory '/home/azureuser/.azure'
Extensions directory '/home/azureuser/.azure/cliextensions'

Python (Linux) 3.14.5 (main, Jun 30 2026, 10:52:46) [GCC 11.4.0]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

Additional context

Related to this problem, I use external tool like M365 Agents Toolkit CLI same errs when login

Metadata

Metadata

Assignees

Labels

Accountaz login/accountAuto-AssignAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamact-identity-squadbugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions