Azure and Entra ID "AADSTS" errors: what the most common codes mean, and how to fix them
Fix Microsoft Entra ID AADSTS sign-in errors: 50076 (MFA), 700016 (app not found), 7000215 (bad secret), 50011 (reply URL), 65001 (consent), 53003 (Conditional Access).
by OhSudo ·
AADSTS50076: Due to a configuration change made by your administrator, or because you moved to a new location, you must use multi-factor authentication to access '797f4846-ba00-4fd7-ba43-dac1f8f63013'.Trace ID: 0a1b2c3d-...Correlation ID: 4e5f6a7b-...Timestamp: 2026-11-06 09:12:45ZAADSTS is the prefix on errors from Microsoft’s sign-in service, Microsoft Entra ID, which used to be called Azure Active Directory. The number is what matters, so find it first and look it up below. You can also paste any code at login.microsoftonline.com/error for Microsoft’s description.
To an administrator, the Correlation ID and Timestamp are the useful parts, as they find the exact attempt in the logs.
Most common codes
| Code | Means | Fix |
|---|---|---|
| 50076, 50079, 50158 | MFA or another challenge is required | Sign in interactively (section 1) |
| 50126 | Wrong user name or password | Check them, and whether the account is federated |
| 50034 | The user doesn’t exist in this tenant | Check the UPN and the tenant |
| 50053 | The account is locked out | Wait, or check for a client retrying an old password |
| 50055 | The password has expired | Change it |
| 50057 | The account is disabled | Ask an administrator |
| 53003 | Blocked by Conditional Access | Section 5 |
| 65001 | Nobody has consented to this app | Section 4 |
| 70011 | The scope isn’t valid | Check the requested scope’s spelling |
| 70043, 700082 | The refresh token has expired | Sign in again (section 1) |
| 700016 | The application isn’t found in this tenant | Section 2 |
| 7000215, 7000222 | Invalid or expired client secret | Section 3 |
| 50011 | The reply URL doesn’t match | Section 4 |
| 90002 | The tenant isn’t found | Check the tenant ID |
1. MFA and expired sessions (50076, 700082)
These tell you that a person has to sign in, and a script or an old session can’t. In the Azure CLI:
az logoutaz loginaz login --tenant 11111111-2222-3333-4444-555555555555az account showIs the Azure CLI on a machine with no browser? Use az login --use-device-code.
Passing -u and -p to az login doesn’t work for accounts with MFA. As of 2025, Microsoft requires MFA for all sign-ins to the Azure portal, CLI, and PowerShell, so a script that uses a person’s password will stop working. Automation should use a service principal or a managed identity, not a person’s account:
az login --service-principal --username "$APP_ID" --password "$SECRET" --tenant "$TENANT_ID"az login --identity # on an Azure VM with a managed identityIn a pipeline, workload identity federation is better still, as there’s no secret to store or expire.
2. App not found (700016)
AADSTS700016: Application with identifier 'abc...' was not found in the directory 'Contoso'.Check these, in order:
- The wrong tenant. Is the app registered in a different one? A common cause is
/commonor a wrong tenant ID in the URL. - A typo in the client ID. You want the Application (client) ID, and not the Object ID, which is also a GUID on the same page.
- It’s an app from another tenant that hasn’t been added to yours. An administrator needs to consent first (section 4).
- It’s been deleted, or hasn’t reached every server yet, if it’s only just been created.
az ad app show --id "$APP_ID" --query '{name:displayName, audience:signInAudience}'az ad sp show --id "$APP_ID" --query displayName3. Client secret (7000215, 7000222)
AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret IDThe message gives the classic mistake away. The portal shows two columns under Certificates & secrets, Value and Secret ID, and you need the Value. It’s only shown once, when you create it. So, if you didn’t save it, make a new one:
az ad app credential reset --id "$APP_ID" --append --display-name ci-2026az ad app credential list --id "$APP_ID" --query '[].{name:displayName, ends:endDateTime}'7000222 means it has expired, so the same command applies, and --append keeps the old one working during the change. Set a reminder for the new end date. Check special characters too: a secret passed through a shell or a YAML file without quotes can get changed on its way.
4. Reply URL and consent (50011, 65001)
AADSTS50011: The redirect URI 'https://app.example.com/callback' specified in the request does not match the redirect URIs configured for the applicationThe URL must match exactly what’s registered, under Authentication, including https, the port, the path, and any trailing /. Behind a proxy, your application may build it as http://, or with an internal address, so look at the value in the error, and fix your forwarded headers if needed.
AADSTS65001: The user or administrator has not consented to use the applicationSomeone has to approve the app’s permissions. A user can do so for their own use, if the tenant allows that. Otherwise, an administrator grants consent for the whole tenant under API permissions → Grant admin consent:
az ad app permission admin-consent --id "$APP_ID"5. Conditional Access (53003)
AADSTS53003: Access has been blocked by Conditional Access policies.Your organization’s policy refused this sign-in, based on where it’s from, the device or the app. You can’t solve this one yourself, so give your administrator the Correlation ID and Timestamp. They’ll find the attempt under Entra ID → Sign-in logs, and its Conditional Access tab shows which policy applied. The usual reasons are an unmanaged device, or a location outside the allowed list.
6. See what’s in your token
If you’re signing in, and a service still refuses you, look at the token. Get one, and paste it in the JWT Decoder, which runs in your browser:
az account get-access-token --query accessToken -o tsvLook at aud (who it’s for), tid (the tenant), scp or roles (what it allows) and exp. A token for the wrong audience or tenant is a common cause of a 401 or 403 from an API. For expired tokens, see jwt expired. A clock that’s wrong on your machine can give AADSTS700024 and others, so check that too.
Warning
Don’t share the whole error publicly without looking at it, as it may show your tenant name, user and app IDs. Don’t turn off MFA or Conditional Access to get a script working. Give the script its own identity, with only the access it needs.
Shell, we have a problem!
Similar, but different: AuthorizationFailed from Azure Resource Manager means you signed in, and your role doesn’t allow it: check az role assignment list. The access token is from the wrong issuer means the wrong tenant. The same idea on AWS is not authorized to perform. And Login failed for user '<token-identified principal>' on Azure SQL means the database has no such user. On Google Cloud, see The caller does not have permission.
Found this useful? Share it.
Found a mistake? Let us know at contact@ohsudo.com.