Your Azure DevOps pipeline stops at the sign-in step of an Azure CLI, ARM template or Terraform task with AADSTS700213: No matching federated identity record found for presented assertion subject. The service connection uses workload identity federation, so there’s no secret to renew. Something in the trust between Azure DevOps and your Microsoft Entra identity no longer lines up. This guide shows how to read the values the service connection presents and the values your identity trusts, how to compare them with a short script, and how to fix each cause. If you deploy Data Factory with the ADF CI/CD pipeline from Azure DevOps, this is the error you’ll see when its Azure Resource Manager connection breaks. It’s based on Microsoft Learn as of November 2026. See What was tested for this post for what was and wasn’t run.
Short answer
AADSTS700213 means Microsoft Entra ID received the service connection’s token, but no federated credential on the identity has the same subject. Microsoft’s troubleshooting page puts it simply: “No federated credential was created or the subject is not correct” (Troubleshoot workload identity service connections). To fix it:
- Copy the two values Azure DevOps generates. In Project settings > Service connections, edit the connection and copy Issuer and Subject identifier.
- Open the identity the connection uses: the app registration (Certificates & secrets > Federated credentials) or the user-assigned managed identity (Settings > Federated credentials).
- Make one credential match exactly: same issuer, same subject, audience
api://AzureADTokenExchange. Matching is case-sensitive, and stray spaces count. - Wait a few minutes, then run the pipeline again. A new credential takes time to propagate.
- If the connection is flagged as using the deprecated Azure DevOps issuer, convert it. That issuer retires on 1 July 2027 (Manually set a workload identity service connection).

What the error actually means
With workload identity federation, Azure DevOps issues an OpenID Connect token for the service connection. The task exchanges that token with Microsoft Entra ID for an Azure access token. Entra ID only does the exchange if the identity (an app registration or a user-assigned managed identity) has a federated identity credential whose issuer, subject and audience match the token’s claims, case-sensitively (Workload identity federation overview).
A few rules from Microsoft’s federated credential considerations explain most of the surprises:
- Wildcards aren’t supported in any federated credential property.
- The issuer and subject pair must be unique on the identity, and an identity can hold at most 20 federated credentials.
- A wrong subject saves without any error. You only find out when the token exchange fails.
- Leading or trailing whitespace in the issuer blocks the exchange.
- A request made a few minutes after you add a credential can still fail while the change propagates.
So AADSTS700213 is an identity-layer failure, not a permissions failure. The pipeline never got a token, which means no Azure role is involved yet. As in the APIM 401 guide, find the failing layer before you change anything.
The issuer and subject formats
Learn documents two issuer types. The format matters, because it decides what can break the subject (issuer table):
Issuer and subject formats (from Microsoft Learn)
Azure DevOps issuer (deprecated, retires 1 July 2027)
issuer : https://vstoken.dev.azure.com/<organization id>
subject: sc://<organization name>/<project name>/<service connection name>
Microsoft Entra issuer (default for new connections)
issuer : https://login.microsoftonline.com/<tenant id>/v2.0
subject: <Microsoft Entra prefix>/sc/<organization id>/<service connection id>My reading of these formats, which isn’t stated on Learn: with the old issuer, renaming the organization, project or connection changes the subject. Learn lists exactly that as a cause of AADSTS70021. With the Entra issuer the subject is built from IDs, so a rename shouldn’t matter. Deleting a connection and recreating it with the same name does matter, because the new connection has a new ID and therefore a new subject.
Which AADSTS code do you have?
Several codes look alike. Microsoft’s troubleshooting page maps them to causes; this is a condensed version (Microsoft Entra ID error codes for service connections):
| Code | What it means | Check first |
|---|---|---|
AADSTS700213 | No credential with this subject | Credential subject |
AADSTS700211 | No credential with this issuer | Credential issuer |
AADSTS70021 | Issuer or subject doesn’t match | Both values, and propagation |
AADSTS70025 | Identity has no federated credentials | Add one |
AADSTS700016 | Application not found | Client ID on the connection |
AADSTS700024 | Assertion outside its valid time | Long-running job |
AADSTS700223 | Federation disabled in the tenant | Entra tenant policy |
AADSTS700238 | Federation constrained for this issuer | Entra tenant policy |
AADSTS70052 | Multitenant app with the Entra issuer | Use a single-tenant app |
If the log shows Identity not found, Could not fetch access token for Azure or unsupported protocol scheme instead, the task itself doesn’t support workload identity federation. unrecognized arguments: --federated-token means the agent has an Azure CLI older than 2.30. Neither is a credential mismatch. For codes not listed, use the Entra error code reference.
Prerequisites
- Service connection administrator (endpoint administrator) rights on the connection in Azure DevOps.
- For an app registration: owner of the app, or an Entra role that can manage its federated credentials.
- For a user-assigned managed identity: Managed Identity Federated Credential Contributor, Managed Identity Contributor or a role with the same rights (required permissions).
- Azure CLI with the azure-devops extension, which installs itself the first time you run an
az devopscommand (az devops service-endpoint), plus Python 3 for the comparison script. - Steps 1 to 4 only read. Nothing changes until Step 5.
Azure DevOps permissions and Azure or Entra permissions are separate. You may be able to edit the service connection and still need an identity owner to change the federated credential.
Step 1: Capture the exact error
Open the failed job, expand the task that signs in and copy the full AADSTS line. In Learn’s examples the message also names the assertion issuer and subject that Entra ID received. When yours does, that is the exact value the identity must trust. Note which task failed, too: if only one of several tasks fails, compare its connection with the others before you touch the identity.
Step 2: Read what the service connection presents
In the portal, the edit dialog of the service connection shows Issuer and Subject identifier. Learn notes you can also get them from the REST response. With the CLI, the values are in the connection’s authorization parameters (automate workload identity service connections):
Get the issuer and subject (example, not executed)
ORG=https://dev.azure.com/contoso
PROJECT=data-platform
SC_NAME=sc-adf-prod
SC_ID=$(az devops service-endpoint list --org "$ORG" --project "$PROJECT" \
--query "[?name=='$SC_NAME'].id" -o tsv)
az devops service-endpoint show --id "$SC_ID" --org "$ORG" --project "$PROJECT" \
--query authorization.parameters > sc.json
cat sc.jsonExpected result: based on Learn’s example, the JSON includes serviceprincipalid, tenantid, workloadIdentityFederationIssuer, workloadIdentityFederationIssuerType (EntraID for the new issuer) and workloadIdentityFederationSubject. serviceprincipalid holds the client (application) ID of the identity the connection uses. If the federation fields are missing, the connection probably isn’t a workload identity connection.
Step 3: Read what the identity trusts
Use the client ID from sc.json to find the identity, then list its federated credentials (az ad app federated-credential, az identity federated-credential):
List the federated credentials (example, not executed)
APP_ID=$(jq -r .serviceprincipalid sc.json)
# App registration
az ad app federated-credential list --id "$APP_ID" > fic.json
# User-assigned managed identity: find it by client ID, then list
az identity list --query "[?clientId=='$APP_ID'].{name:name, rg:resourceGroup}" -o tsv
MI_NAME=uami-ado-prod; MI_RG=rg-identity # values from the line above
az identity federated-credential list --identity-name "$MI_NAME" --resource-group "$MI_RG" > fic.jsonExpected result: a JSON array with one object per credential, each with name, issuer, subject and audiences. az identity list only searches the current subscription. Add --subscription if the identity lives elsewhere. If neither command finds the client ID, the connection points at an identity that no longer exists, which Learn maps to AADSTS700016.
Step 4: Compare the two values with a script
Eyeballing two long strings is how trailing spaces and case differences slip through. This script compares the files from Steps 2 and 3 exactly and says what differs. It needs only the Python standard library.
wif_check.py (run locally against synthetic JSON, Python 3.13.5)
#!/usr/bin/env python3
"""Compare what an Azure DevOps service connection presents with the
federated credentials on its identity.
python3 wif_check.py sc.json fic.json
sc.json : az devops service-endpoint show --id <id> --query authorization.parameters
fic.json: az ad app federated-credential list --id <appId>
or: az identity federated-credential list --identity-name <name> -g <rg>
"""
import json, sys
AUD = "api://AzureADTokenExchange"
sc = json.load(open(sys.argv[1]))
fics = json.load(open(sys.argv[2]))
iss = sc.get("workloadIdentityFederationIssuer", "")
sub = sc.get("workloadIdentityFederationSubject", "")
print(f"Service connection presents\n issuer : {iss!r}\n subject: {sub!r}")
print(f"Identity has {len(fics)} federated credential(s); the limit is 20")
def compare(name, mine, theirs):
if mine == theirs: return f"{name} matches"
if mine.strip() == theirs.strip(): return f"{name} differs only by whitespace"
if mine.lower() == theirs.lower(): return f"{name} differs only by case"
if name == "issuer" and "vstoken" in mine: return "issuer is the old Azure DevOps issuer"
return f"{name} differs"
issuer_ok = subject_ok = False
for f in fics:
i, s, a = f.get("issuer", ""), f.get("subject", ""), f.get("audiences", [])
notes = [compare("issuer", i, iss), compare("subject", s, sub)]
if AUD not in a: notes.append(f"audience is {a}, expected {AUD}")
issuer_ok |= i == iss
if i == iss and s == sub and AUD in a: subject_ok = True
print(f"- {f.get('name')}: " + "; ".join(notes))
if subject_ok:
print("RESULT: exact match found. If it was added minutes ago, wait and retry.")
sys.exit(0)
if not fics:
print("RESULT: no federated credentials (likely AADSTS70025). Add one.")
elif not issuer_ok:
print("RESULT: no credential has this issuer (likely AADSTS700211). Fix the issuer.")
else:
print("RESULT: issuer found, subject or audience doesn't match (likely AADSTS700213).")
sys.exit(2)Run it
python3 wif_check.py sc.json fic.jsonOutput from the local run for a recreated connection (synthetic values, IDs shortened)
Service connection presents
issuer : 'https://login.microsoftonline.com/aaaabbbb-0000-cccc-1111-dddd2222eeee/v2.0'
subject: 'ENTRA-PREFIX/sc/<org-id>/<sc-id>'
Identity has 1 federated credential(s); the limit is 20
- ado-sc: issuer matches; subject differs
RESULT: issuer found, subject or audience doesn't match (likely AADSTS700213).I ran it against six made-up pairs of files. The expected AADSTS code in the output is my mapping of Learn’s descriptions, not something Entra ID returned:
| Test file | Simulates | Script result |
|---|---|---|
fic-old-issuer | Identity still on the old issuer | Issuer mismatch (700211) |
fic-recreated | Connection recreated, new ID | Subject mismatch (700213) |
fic-typo | Trailing space in subject | Whitespace only (700213) |
fic-case | Issuer in upper case | Case only (700211) |
fic-ok | Match plus an unrelated credential | Exact match, exit 0 |
fic-empty | No credentials | None found (70025) |

Step 5: Fix the cause
The connection moved to the Entra issuer, but the identity didn’t
When Azure DevOps created the identity, editing and saving the connection updates the issuer for you. If you created the identity yourself, you must update the credential by hand. During a conversion that can’t update the identity, Azure DevOps shows the issuer and subject to add (convert existing service connections). Update the existing credential rather than adding a near-duplicate, so you stay well under the 20-credential limit:
Update the credential with the connection’s values (example, not executed)
# App registration: credential.json holds name, issuer, subject, audiences
cat > credential.json <<'EOF'
{
"name": "ado-sc-adf-prod",
"issuer": "<workloadIdentityFederationIssuer from sc.json>",
"subject": "<workloadIdentityFederationSubject from sc.json>",
"audiences": ["api://AzureADTokenExchange"]
}
EOF
az ad app federated-credential update --id "$APP_ID" \
--federated-credential-id ado-sc-adf-prod --parameters credential.json
# User-assigned managed identity
az identity federated-credential update --name ado-sc-adf-prod \
--identity-name "$MI_NAME" --resource-group "$MI_RG" \
--issuer "$(jq -r .workloadIdentityFederationIssuer sc.json)" \
--subject "$(jq -r .workloadIdentityFederationSubject sc.json)" \
--audiences api://AzureADTokenExchangeReading the values with jq straight from sc.json avoids retyping them. In the portal, the equivalent is the Other issuer scenario with the Explicit subject identifier type.
The connection was deleted and recreated
With the Entra issuer the subject contains the connection’s ID, so a recreated connection presents a new subject even if its name is the same. Replace the subject on the credential. If several connections share one identity, each one needs its own credential, because every connection has its own subject.
A value was retyped, trimmed or changed case
Paste the issuer and subject again from the connection or sc.json. Don’t edit them by hand. The script in Step 4 reports “differs only by whitespace” or “only by case” for these.
The connection points at a different identity
If the client ID in the connection isn’t the identity you edited, you fixed the wrong object. This tends to happen when a connection is copied between environments. Either add the credential to the identity the connection really uses, or change the connection’s client ID and add the credential there.
The organization, project or connection was renamed (old issuer only)
Learn lists renames as the cause when AADSTS70021 shows an sc:// subject. Either convert the connection to the Entra issuer, which stops names from mattering, or update the subject to the new sc:// path.
The credential is brand new
If Step 4 reports an exact match and the credential is minutes old, wait and retry. Learn describes exactly this window, where a cache with old data returns AADSTS70021, and recommends retrying token requests (propagation time).
Adding the credential fails
On a user-assigned managed identity, creating several credentials at once returns 409 Conflict, so create them one after another. Remember the 20-credential limit. Creating federated credentials on user-assigned identities isn’t supported in Malaysia South at the time of writing (considerations).
Step 6: Verify the fix
In the service connection, select Verify and save. Then run a pipeline that does nothing but sign in:
Minimal sign-in check (example, not executed)
steps:
- task: AzureCLI@2
inputs:
azureSubscription: sc-adf-prod
scriptType: bash
scriptLocation: inlineScript
inlineScript: az account show --query "{subscription:name, tenant:tenantId}" -o tableExpected result: the task signs in and prints the subscription name and tenant ID (AzureCLI@2 reference). If you now get AuthorizationFailed, federation works and the identity is just missing a role on the target scope. That’s a different layer, the same distinction as Unauthorized versus Forbidden in the Logic Apps Key Vault guide. Role assignments can take up to 10 minutes to apply (Azure RBAC troubleshooting). The same delay shows up in the Databricks ADLS mount 403 checks.
Keep this separate from errors where a token is issued and the target then rejects it. Login failed for user token-identified principal in ADF is that kind: authentication worked, the database didn’t know the identity.
Security, reliability, monitoring and cost
- Security. Workload identity federation removes the client secret, which is why Learn recommends converting connections that fail with an expired secret (
AADSTS7000215). Authorize each pipeline for the connection rather than granting access to all pipelines (Learn). Grant the identity the narrowest role and scope it needs, and delete federated credentials you no longer use. Every credential is a token the identity will accept.addSpnToEnvironmentexposes the federation token to scripts asidToken, so never echo it. The same no-secrets approach is covered in securing data pipelines with managed identity and Key Vault. - Reliability. Find connections flagged as using the Azure DevOps issuer and convert them well before 1 July 2027. In automation, create objects in order: identity, service connection, federated credential, role assignment. The credential can only be created after the connection exists (Learn). The same applies to Terraform deployments from a pipeline.
- Monitoring. Pipeline failure notifications catch the error first. If you can read Entra sign-in logs, the Service principal sign-ins and Managed identity sign-ins views show sign-in activity for these identities (sign-in logs).
- Cost. The fix only changes configuration on objects you already have. No prices are quoted here.
What was tested for this post
- Run locally:
wif_check.pyagainst six synthetic pairs of JSON files (Python 3.13.5). The values are made up. The Entra-issuer subject uses a placeholder prefix, because Learn doesn’t publish that prefix’s format. - Checked, not executed: the parameter names in every
azcommand, against--helpin Azure CLI 2.93.0 with the azure-devops extension 1.0.12; the bash snippets withbash -n; the pipeline YAML with a YAML parser. - Not executed: every
azcommand, the pipeline YAML and the portal steps. No Azure DevOps organization, tenant or identity was used, and no real error log was captured. - Inferred, not stated on Learn: that renames no longer affect Entra-issuer subjects, and the error-code hints in the script output.
Related guides
For the pipeline that most often uses this connection, see CI/CD for Azure Data Factory with Azure DevOps. For identity-based deployments of storage, see Terraform for ADLS Gen2 with hierarchical namespace. More posts are in the Azure Data Engineering category.
Sources
- Troubleshoot an Azure Resource Manager workload identity service connection (Microsoft Learn)
- Manually set an Azure Resource Manager workload identity service connection (Microsoft Learn)
- Connect to Azure with an Azure Resource Manager service connection (Microsoft Learn)
- Use scripts to automate Azure Resource Manager with workload identity service connections (Microsoft Learn)
- Workload identity federation (Microsoft Learn)
- Important considerations and restrictions for federated identity credentials (Microsoft Learn)
- Configure an app to trust an external identity provider (Microsoft Learn)
- Configure a user-assigned managed identity to trust an external identity provider (Microsoft Learn)
- Microsoft Entra authentication and authorization error codes (Microsoft Learn)
- az devops service-endpoint (Azure CLI reference)
- az ad app federated-credential (Azure CLI reference)
- az identity federated-credential (Azure CLI reference)
- AzureCLI@2 task reference (Microsoft Learn)
- Troubleshoot Azure RBAC (Microsoft Learn)
- Sign-in logs in Microsoft Entra ID (Microsoft Learn)




