Skip to content

Authentication failed with az login #34169

Description

@yanancai

Describe the bug

Authentication failed
invalid_client: AADSTS50012: Authentication failed. Trace ID: 3ddd87b8-ac90-4a2d-847b-ef56db543b00 Correlation ID: baf678a2-4691-43b2-8aae-fdb77382ef1f Timestamp: 2026-10-05 20:03:00Z. (https://login.microsoftonline.com/error?code=50012)

You can log an issue at Azure CLI GitHub Repository and we will assist you in resolving it.

Related command

az login then choose githubazure.com account

Errors

Authentication failed
invalid_client: AADSTS50012: Authentication failed. Trace ID: 3ddd87b8-ac90-4a2d-847b-ef56db543b00 Correlation ID: baf678a2-4691-43b2-8aae-fdb77382ef1f Timestamp: 2026-10-05 20:03:00Z. (https://login.microsoftonline.com/error?code=50012)

Issue script & Debug output

Authentication failed
invalid_client: AADSTS50012: Authentication failed. Trace ID: 3ddd87b8-ac90-4a2d-847b-ef56db543b00 Correlation ID: baf678a2-4691-43b2-8aae-fdb77382ef1f Timestamp: 2026-10-05 20:03:00Z. (https://login.microsoftonline.com/error?code=50012)

Expected behavior

it worked last week

Environment Summary

az --version
azure-cli 2.87.0 *

core 2.87.0 *
telemetry 1.1.0

Extensions:
account 0.2.5
kusto 0.5.0
resource-graph 2.1.1

Dependencies:
msal 1.36.0
azure-mgmt-resource 24.0.0

Additional context

No response

Activity

  1. added
    bugThis issue requires a change to an existing behavior in the product in order to be resolved.
    on Oct 5, 2026
  2. added
    Accountaz login/account
    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 Oct 5, 2026
  3. x-engineering-agent commented on Oct 5, 2026

    @x-engineering-agent
    Contributor

    Yanan Cai (@yanancai), the command, AADSTS50012 error, and CLI/MSAL versions are already clear. Could you try az login --use-device-code with the same account and report whether it succeeds, or the error code if it fails?

    Azure CLI 2.87.0 uses separate interactive and device-code sign-in paths. This comparison will help narrow whether the failure is specific to interactive sign-in before proposing a CLI change.

    Please share only the outcome/error code, not the device code, tokens, or full debug logs. I will revisit the issue when you reply.

    Posted by x-engineering-agent (Fixer)

  4. microsoft-github-policy-service commented on Oct 5, 2026

    @microsoft-github-policy-service
    Contributor

    🔔 Routing this issue to @Azure/act-identity-squad.

  5. removed
    questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
    on Oct 6, 2026
  6. added this to the Backlog milestone on Oct 6, 2026
  7. yonzhan commented on Oct 6, 2026

    @yonzhan
    Collaborator

    az login

  8. isra-fel commented on Oct 8, 2026

    @isra-fel
    Member

    AADSTS50012 means something's wrong with the certificate. Please ensure you are using the correct certificate for authentication.
    https://learn.microsoft.com/en-us/entra/identity-platform/reference-error-codes

    Image
  9. microsoft-github-policy-service commented on Oct 8, 2026

    @microsoft-github-policy-service
    Contributor

    🔔 Routing this issue to @Azure/act-identity-squad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Accountaz login/accountAuto-AssignAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamact-identity-squadagent-assist-needs-infoWaiting for information requested by agent-assistbugThis issue requires a change to an existing behavior in the product in order to be resolved.needs-author-feedbackMore information is needed from author to address the issue.

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions