// troubleshooting guide · azure devops

Azure DevOps Service Connection 'Failed to Obtain the JSON Web Token'

Status
Ongoing
platforms:
Azure Pipelines
updated:
November 16, 2026
reports:
3
Method
how we research
Share

RUNBOOK · azure-devops/service-connection-jwt-error4 FIXES

// quick answer

A workload identity federation service connection can't get a token because the federated credential's issuer or subject doesn't match, the tenant blocks it, or the token expired mid-run. Edit and save the connection, or fix the federated credential.

Most likely fix: Edit and save the service connection

How to fix it

// try these in order, the most common fix is first

  1. FIX 1Edit and save the service connection

    1. 01Project settings > Service connections > select the connection > Edit > Save
    2. 02This refreshes the issuer and subject for connections Azure DevOps created
    3. 03Run Verify to test it
    Did this fix it?
  2. FIX 2Fix the federated credential manually

    1. 01In the Azure portal open the app registration or managed identity > Certificates & secrets > Federated credentials
    2. 02Copy issuer and subject from the service connection's details
    3. 03Make sure they match exactly, then retry
    Did this fix it?
  3. FIX 3Handle long-running jobs

    1. 01For AADSTS700024 after about an hour, use a managed identity-based connection as Microsoft suggests
    2. 02Use task versions with ID token refresh (e.g. Terraform task v5)
    Did this fix it?
  4. FIX 4Ask your tenant admin

    1. 01For AADSTS700223/700238, ask the Entra admin to allow workload identity federation for your Azure DevOps org
    2. 02Update the Azure CLI on self-hosted agents to 2.30 or later
    Did this fix it?

Symptoms

Azure tasks fail with 'Failed to obtain the JSON Web Token (JWT)', AADSTS700213, AADSTS700024 (client assertion expired) or AADSTS700223.

Why it happens

  • C-01The organization, project or service connection was renamed so the federation subject no longer matches
  • C-02The federated credential's issuer is wrong (Azure DevOps vs Microsoft Entra issuer)
  • C-03The Entra tenant disabled workload identity federation
  • C-04ID token expired on jobs running about an hour
  • C-05Old Azure CLI on the agent (needs 2.30+)

// this guide also covers

  • failed to obtain the json web token azure devops
  • aadsts700024 azure devops
  • workload identity federation service connection error

Still not working?

If Azure DevOps keeps failing, you're not alone. See every Azure DevOps problem users report or the alternatives people switch to.

Have an app idea? Our small team builds any software: web and mobile apps, games, desktop, AI tools. Price agreed together.

Talk to us

Watch Azure DevOps Get an email when its price changes, it has an outage, or we publish a new fix. No spam.

Fixed it? Share this guide

The same problem in other apps

All not loading, error messages & connection guides →

Other Azure DevOps errors

All 12 Azure DevOps errors and fixes →