// 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
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
FIX 1Edit and save the service connection
- 01Project settings > Service connections > select the connection > Edit > Save
- 02This refreshes the issuer and subject for connections Azure DevOps created
- 03Run Verify to test it
Did this fix it?FIX 2Fix the federated credential manually
- 01In the Azure portal open the app registration or managed identity > Certificates & secrets > Federated credentials
- 02Copy issuer and subject from the service connection's details
- 03Make sure they match exactly, then retry
Did this fix it?FIX 3Handle long-running jobs
- 01For AADSTS700024 after about an hour, use a managed identity-based connection as Microsoft suggests
- 02Use task versions with ID token refresh (e.g. Terraform task v5)
Did this fix it?FIX 4Ask your tenant admin
- 01For AADSTS700223/700238, ask the Entra admin to allow workload identity federation for your Azure DevOps org
- 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 usThe same problem in other apps
Other Azure DevOps errors
- Azure DevOps No Hosted Parallelism Has Been Purchased or Granted
- Azure DevOps Pipeline Stuck in Queue (Waiting for an Available Agent)
- Azure DevOps Pipeline Not Triggering on Push
- Azure DevOps Git Authentication Failed (PAT Not Working)
- Azure DevOps TF401027: You Need the Git 'GenericContribute' Permission
- Azure Pipelines Job Canceled After 60 Minutes
- Azure Artifacts Feed 401 Unauthorized (Unable to Load the Service Index)
- Why Is Azure DevOps Boards So Slow?