AADSTS700016: Application not found in the directory
Short answer: AADSTS700016 means the client application ID in the request isn't found in the tenant the request was sent to. It is almost always a developer error: wrong client ID, wrong tenant, or an app never added to the tenant. Unknown client IDs or a deleted malicious app still trying to sign in are worth a look.
Fix: Developer: compare the client ID in your config with the app registration's Application (client) ID, and check that the authority URL names the tenant where the app is registered (or that a multi-tenant app is consented there). If the app was deleted, restore it or register a new one. Full steps
| Code | AADSTS700016 |
|---|---|
| Microsoft name | UnauthorizedClient_DoesNotMatchRequest |
| Category | App configuration |
| Type | Failure |
| Attack signal | Low: usually configuration or user error |
| Where to look | SigninLogs, AADServicePrincipalSignInLogs |
| Microsoft lookup | login.microsoftonline.com/error?code=700016 |
What does AADSTS700016 mean?
Section titled “What does AADSTS700016 mean?”Microsoft’s description:
UnauthorizedClient_DoesNotMatchRequest: The application wasn’t found in the directory/tenant. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You might have misconfigured the identifier value for the application or sent your authentication request to the wrong tenant.
The application that is missing is the client (the app asking for a token). If the missing object is the API being called, the error is 500011 instead.
Reproduced in the lab
Section titled “Reproduced in the lab”On 25 October 2026 an automated lab run sent a token request with a client ID that isn’t registered anywhere. Entra returned AADSTS700016 with this first line:
AADSTS700016: Application with identifier ‘{app-id}’ was not found in the directory ‘{tenant-id}’.
That confirms the code and its wording at the token endpoint.
The same attempt in the lab tenant’s sign-in log (Entra admin center, interactive user sign-ins), with identifiers left out:
| Field | Value in the lab row |
|---|---|
| Status | Failure |
| Sign-in error code | 700016 |
| Failure reason | Application with identifier ‘{appIdentifier}’ was not found in the directory ‘{tenantName}’. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. |
| Application | (empty) |
| Application ID | the unknown client ID from the request |
| App owner tenant ID | (empty) |
| Resource | Microsoft Graph |
| Conditional Access | Not Applied |
| User type | Member |
The Application name is empty and there is no app owner tenant, only the unknown client ID. In SigninLogs that should appear as an empty AppDisplayName with an AppId that matches nothing in your tenant, which is a clean way to find these rows. The KQL below was run on the lab rows (how). The first query found both lab rows, one per unknown client ID. The second query, with the placeholder replaced by one of those IDs, found its row.
Is it an attack?
Section titled “Is it an attack?”Almost always not. Typical causes:
- A typo or copy-paste error in the client ID.
- The request goes to the wrong tenant (wrong tenant ID or domain in the authority URL).
- A single-tenant app used from another tenant.
- A multi-tenant app that nobody in your tenant has consented to yet.
- An app registration that was deleted while a script or service still uses it.
| Pattern | Likely meaning |
|---|---|
| One internal app ID, failing since a deployment | Wrong client ID or tenant in config. Benign. |
| An app you deleted recently, still failing | Something still uses it. Find and update the caller. |
| An app you removed during an incident (for example after an illicit consent grant), still failing | The attacker’s tooling is still trying. Note the IPs and times. |
| Client IDs you don’t recognise, from external IPs, across your tenant | Someone checking whether their app exists in your tenant. Investigate. |
The last two rows are our reasoning, not Microsoft statements. Microsoft’s illicit-consent guidance describes removing a malicious app’s access; it doesn’t describe the 700016 rows that follow. If you remove the service principal, a client that still uses that app ID against your tenant would match the description above. Two neighbouring codes may show instead: 700011 (“Application with identifier {appIdentifier} was not found in the directory”) for a removed app, and 7000112 (“The application is disabled”) while the service principal is disabled. Which one a removed app returns isn’t documented; the consent phishing guide treats all three as the aftermath to watch for.
How do I find it in my logs (KQL)?
Section titled “How do I find it in my logs (KQL)?”700016 grouped by the client app ID, so you can check each one against your app registrations:
SigninLogs| where TimeGenerated > ago(14d)| where ResultType == "700016"| summarize Attempts = count(), Users = dcount(UserPrincipalName), IPs = make_set(IPAddress, 10), AppNames = make_set(AppDisplayName, 5), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated) by AppId| sort by Attempts descAppDisplayName may be empty on these rows, since the tenant has no object for the app. Look up the AppId yourself.
After an incident: has a removed app ID tried again?
let removedApp = "<app-id-you-removed>";union (SigninLogs | where AppId == removedApp), (AADServicePrincipalSignInLogs | where AppId == removedApp)| where TimeGenerated > ago(30d)| project TimeGenerated, Type, ResultType, ResultDescription, IPAddress, UserPrincipalName, ServicePrincipalName| sort by TimeGenerated descThe empty AppDisplayName is confirmed in the lab’s user sign-in rows. Whether 700016 also shows up in AADServicePrincipalSignInLogs is not verified. Microsoft’s table reference for the service principal table describes ResultType as Success or Failure, so check whether the numeric code appears there before you build a rule on it.
How does Conditional Access affect it?
Section titled “How does Conditional Access affect it?”- 700016 is not a Conditional Access result. There is no application object in the tenant for a policy to target.
- Once the app is added or consented, your policies apply as normal. Conditional Access targets the resource being requested, not the client application, so a policy on “All resources” or on the specific API covers the tokens this client asks for.
- The control that matters here is consent. Microsoft’s illicit-consent guidance notes that resetting passwords or requiring MFA isn’t effective against an app that already holds consent. Removing the app’s grants and service principal is what ends that access, and 700016 can be what the attacker’s tool sees afterwards.
How do I fix AADSTS700016?
Section titled “How do I fix AADSTS700016?”For developers:
- Compare the client ID in your code or config with the Application (client) ID on the app registration.
- Check the authority URL. The tenant in it must be the tenant where the app is registered, or the app must be multi-tenant and consented in the target tenant.
- If the app was deleted, restore it or register a new one and update every caller.
For admins:
- Check each unknown
AppIdfrom the first query. If it is a third-party app nobody asked for, leave it out of the tenant. - If the app ID belongs to something you removed during an incident, keep the evidence (IPs, times, user agents) and don’t re-add the app.
Related codes
- AADSTS50011: Reply URL does not match
- AADSTS65001: User or admin has not consented to the app
- AADSTS50020: Account from identity provider not in tenant
- AADSTS7000215: Invalid client secret is provided
- AADSTS500011: The resource principal was not found in the tenant
- AADSTS50001: resource disabled or doesn't exist
More: 50059, 50105, 50194, 51004, 65002, 65005, 70002, 70021, 70025, 90002, 90009, 90019, 90094, 90095, 90133, 500014, 500031, 500113, 500200, 501051, 650052, 650056, 700024, 700051, 700054, 900023, 900144, 900439, 1002016, 1003031, 5000225, 5002730, 7000014, 7000110, 7000112, 7000216, 7000218, 7000222, 9002313, 9002326, 9002331, 9002346, 9010010