# AADSTS700016: Application not found in the directory

Canonical: https://brambrinkmeier.com/entra/aadsts/700016/
By Bram Brinkmeier. JSON: https://brambrinkmeier.com/api/aadsts/700016.json

**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.

| Field | Value |
|---|---|
| Code | AADSTS700016 |
| Microsoft name | UnauthorizedClient_DoesNotMatchRequest |
| Category | App configuration |
| Type | Failure |
| Attack signal | Low: usually configuration or user error |
| Where to look | `SigninLogs`, `AADServicePrincipalSignInLogs` |
| In Microsoft's error reference | Yes |
| Verification | lab-reproduced (2026-10-25) |
| Last updated | 2026-10-30 |

## 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](https://brambrinkmeier.com/entra/aadsts/500011/) instead.

## 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](https://brambrinkmeier.com/methodology/)). 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?

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](https://brambrinkmeier.com/guides/investigate-consent-phishing-entra-id/) treats all three as the aftermath to watch for.

## 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:

```kusto
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 desc
```

`AppDisplayName` 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?

```kusto
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 desc
```

The 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?

- 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?

**For developers:**
1. Compare the client ID in your code or config with the **Application (client) ID** on the app registration.
2. 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.
3. If the app was deleted, restore it or register a new one and update every caller.

**For admins:**
1. Check each unknown `AppId` from the first query. If it is a third-party app nobody asked for, leave it out of the tenant.
2. 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.

## Evidence

Reproduced in a lab tenant on 2026-10-25 (ROPC token request against a lab tenant; scenario: Unknown client ID). First line returned:

> AADSTS700016: Application with identifier '{app-id}' was not found in the directory '{tenant-id}'.

Sign-in log row read: 2026-10-30. KQL run against the exported lab rows: 2026-10-30.

Lab-run rows naming this code (31; full list at https://brambrinkmeier.com/lab-runs.json):

| Date | Scenario | Expected | Got | Message (first line) |
|---|---|---|---|---|
| 2026-10-25 | Unknown client ID | 700016 | 700016 | AADSTS700016: Application with identifier '{app-id}' was not found in the directory '{tenant-id}'. This can |
| 2026-10-30 | Unknown client ID | 700016 | 700016 | AADSTS700016: Application with identifier '{app-id}' was not found in the directory '{tenant-id}'. This can |
| 2026-10-30 | Device code requested on /consumers by a work-account app | 90133 / 9002331 / 700016 | 700016 | AADSTS700016: Application with identifier '{app-id}' was not found in the directory '{tenant-id}'. This can |
| 2026-10-30 | Device code on /common by a single-tenant app | 90133 / 700016 / 50194 | 50059 | AADSTS50059: No tenant-identifying information found in either the request or implied by any provided credentials. |
| 2026-10-30 | Device code on /organizations by a single-tenant app | 90133 / 700016 / 50194 | 50059 | AADSTS50059: No tenant-identifying information found in either the request or implied by any provided credentials. |
| 2026-10-30 | Unknown client ID | 700016 | 700016 | AADSTS700016: Application with identifier '{app-id}' was not found in the directory '{tenant-id}'. This can |
| 2026-10-30 | Device code requested on /consumers by a work-account app | 90133 / 9002331 / 700016 | 700016 | AADSTS700016: Application with identifier '{app-id}' was not found in the directory '{tenant-id}'. This can |
| 2026-10-30 | Device code on /common by a single-tenant app | 90133 / 700016 / 50194 | 50059 | AADSTS50059: No tenant-identifying information found in either the request or implied by any provided credentials. |
| 2026-10-30 | Device code on /organizations by a single-tenant app | 90133 / 700016 / 50194 | 50059 | AADSTS50059: No tenant-identifying information found in either the request or implied by any provided credentials. |
| 2026-10-30 | Unknown client ID | 700016 | 700016 | AADSTS700016: Application with identifier '{app-id}' was not found in the directory '{tenant-id}'. This can |
| 2026-10-30 | Device code requested on /consumers by a work-account app | 90133 / 9002331 / 700016 | 700016 | AADSTS700016: Application with identifier '{app-id}' was not found in the directory '{tenant-id}'. This can |
| 2026-10-30 | Device code on /common by a single-tenant app | 90133 / 700016 / 50194 | 50059 | AADSTS50059: No tenant-identifying information found in either the request or implied by any provided credentials. |
| 2026-10-30 | Device code on /organizations by a single-tenant app | 90133 / 700016 / 50194 | 50059 | AADSTS50059: No tenant-identifying information found in either the request or implied by any provided credentials. |
| 2026-10-30 | Unknown client ID | 700016 | 700016 | AADSTS700016: Application with identifier '{app-id}' was not found in the directory '{tenant-id}'. This can |
| 2026-10-30 | Device code requested on /consumers by a work-account app | 90133 / 9002331 / 700016 | 700016 | AADSTS700016: Application with identifier '{app-id}' was not found in the directory '{tenant-id}'. This can |
| 2026-10-30 | Device code on /common by a single-tenant app | 90133 / 700016 / 50194 | 50059 | AADSTS50059: No tenant-identifying information found in either the request or implied by any provided credentials. |
| 2026-10-30 | Device code on /organizations by a single-tenant app | 90133 / 700016 / 50194 | 50059 | AADSTS50059: No tenant-identifying information found in either the request or implied by any provided credentials. |
| 2026-10-30 | Unknown client ID | 700016 | 700016 | AADSTS700016: Application with identifier '{app-id}' was not found in the directory '{tenant-id}'. This can |
| 2026-10-30 | Device code requested on /consumers by a work-account app | 90133 / 9002331 / 700016 | 700016 | AADSTS700016: Application with identifier '{app-id}' was not found in the directory '{tenant-id}'. This can |
| 2026-10-30 | Device code on /common by a single-tenant app | 90133 / 700016 / 50194 | 50059 | AADSTS50059: No tenant-identifying information found in either the request or implied by any provided credentials. |
| 2026-10-30 | Device code on /organizations by a single-tenant app | 90133 / 700016 / 50194 | 50059 | AADSTS50059: No tenant-identifying information found in either the request or implied by any provided credentials. |
| 2026-10-30 | Unknown client ID | 700016 | 700016 | AADSTS700016: Application with identifier '{app-id}' was not found in the directory '{tenant-id}'. This can |
| 2026-10-30 | Device code requested on /consumers by a work-account app | 90133 / 9002331 / 700016 | 700016 | AADSTS700016: Application with identifier '{app-id}' was not found in the directory '{tenant-id}'. This can |
| 2026-10-31 | Unknown client ID | 700016 | 700016 | AADSTS700016: Application with identifier '{app-id}' was not found in the directory '{tenant-id}'. This can |
| 2026-10-31 | Device code requested on /consumers by a work-account app | 90133 / 9002331 / 700016 | 700016 | AADSTS700016: Application with identifier '{app-id}' was not found in the directory '{tenant-id}'. This can |
| 2026-10-31 | Device code on /common by a single-tenant app | 90133 / 700016 / 50194 | 50059 | AADSTS50059: No tenant-identifying information found in either the request or implied by any provided credentials. |
| 2026-10-31 | Device code on /organizations by a single-tenant app | 90133 / 700016 / 50194 | 50059 | AADSTS50059: No tenant-identifying information found in either the request or implied by any provided credentials. |
| 2026-10-31 | Unknown client ID | 700016 | 700016 | AADSTS700016: Application with identifier '{app-id}' was not found in the directory '{tenant-id}'. This can |
| 2026-10-31 | Device code requested on /consumers by a work-account app | 90133 / 9002331 / 700016 | 700016 | AADSTS700016: Application with identifier '{app-id}' was not found in the directory '{tenant-id}'. This can |
| 2026-10-31 | Device code on /common by a single-tenant app | 90133 / 700016 / 50194 | 50059 | AADSTS50059: No tenant-identifying information found in either the request or implied by any provided credentials. |
| 2026-10-31 | Device code on /organizations by a single-tenant app | 90133 / 700016 / 50194 | 50059 | AADSTS50059: No tenant-identifying information found in either the request or implied by any provided credentials. |

## Sources

1. [Microsoft Entra authentication and authorization error codes](https://learn.microsoft.com/en-us/entra/identity-platform/reference-error-codes)
2. [Detect and remediate illicit consent grants](https://learn.microsoft.com/en-us/defender-office-365/detect-and-remediate-illicit-consent-grants)
3. [SigninLogs table reference (Azure Monitor)](https://learn.microsoft.com/en-us/azure/azure-monitor/reference/tables/signinlogs)
4. [AADServicePrincipalSignInLogs table reference (Azure Monitor)](https://learn.microsoft.com/en-us/azure/azure-monitor/reference/tables/aadserviceprincipalsigninlogs)

## Related codes

[AADSTS50011](https://brambrinkmeier.com/entra/aadsts/50011/), [AADSTS65001](https://brambrinkmeier.com/entra/aadsts/65001/), [AADSTS50020](https://brambrinkmeier.com/entra/aadsts/50020/), [AADSTS7000215](https://brambrinkmeier.com/entra/aadsts/7000215/), [AADSTS500011](https://brambrinkmeier.com/entra/aadsts/500011/), [AADSTS50001](https://brambrinkmeier.com/entra/aadsts/50001/), [AADSTS50059](https://brambrinkmeier.com/entra/aadsts/50059/), [AADSTS50105](https://brambrinkmeier.com/entra/aadsts/50105/), [AADSTS50194](https://brambrinkmeier.com/entra/aadsts/50194/), [AADSTS51004](https://brambrinkmeier.com/entra/aadsts/51004/), [AADSTS65002](https://brambrinkmeier.com/entra/aadsts/65002/), [AADSTS65005](https://brambrinkmeier.com/entra/aadsts/65005/), [AADSTS70002](https://brambrinkmeier.com/entra/aadsts/70002/), [AADSTS70021](https://brambrinkmeier.com/entra/aadsts/70021/), [AADSTS70025](https://brambrinkmeier.com/entra/aadsts/70025/), [AADSTS90002](https://brambrinkmeier.com/entra/aadsts/90002/), [AADSTS90009](https://brambrinkmeier.com/entra/aadsts/90009/), [AADSTS90019](https://brambrinkmeier.com/entra/aadsts/90019/), [AADSTS90094](https://brambrinkmeier.com/entra/aadsts/90094/), [AADSTS90095](https://brambrinkmeier.com/entra/aadsts/90095/), [AADSTS90133](https://brambrinkmeier.com/entra/aadsts/90133/), [AADSTS500014](https://brambrinkmeier.com/entra/aadsts/500014/), [AADSTS500031](https://brambrinkmeier.com/entra/aadsts/500031/), [AADSTS500113](https://brambrinkmeier.com/entra/aadsts/500113/), [AADSTS500200](https://brambrinkmeier.com/entra/aadsts/500200/), [AADSTS501051](https://brambrinkmeier.com/entra/aadsts/501051/), [AADSTS650052](https://brambrinkmeier.com/entra/aadsts/650052/), [AADSTS650056](https://brambrinkmeier.com/entra/aadsts/650056/), [AADSTS700024](https://brambrinkmeier.com/entra/aadsts/700024/), [AADSTS700051](https://brambrinkmeier.com/entra/aadsts/700051/), [AADSTS700054](https://brambrinkmeier.com/entra/aadsts/700054/), [AADSTS900023](https://brambrinkmeier.com/entra/aadsts/900023/), [AADSTS900144](https://brambrinkmeier.com/entra/aadsts/900144/), [AADSTS900439](https://brambrinkmeier.com/entra/aadsts/900439/), [AADSTS1002016](https://brambrinkmeier.com/entra/aadsts/1002016/), [AADSTS1003031](https://brambrinkmeier.com/entra/aadsts/1003031/), [AADSTS5000225](https://brambrinkmeier.com/entra/aadsts/5000225/), [AADSTS5002730](https://brambrinkmeier.com/entra/aadsts/5002730/), [AADSTS7000014](https://brambrinkmeier.com/entra/aadsts/7000014/), [AADSTS7000110](https://brambrinkmeier.com/entra/aadsts/7000110/), [AADSTS7000112](https://brambrinkmeier.com/entra/aadsts/7000112/), [AADSTS7000216](https://brambrinkmeier.com/entra/aadsts/7000216/), [AADSTS7000218](https://brambrinkmeier.com/entra/aadsts/7000218/), [AADSTS7000222](https://brambrinkmeier.com/entra/aadsts/7000222/), [AADSTS9002313](https://brambrinkmeier.com/entra/aadsts/9002313/), [AADSTS9002326](https://brambrinkmeier.com/entra/aadsts/9002326/), [AADSTS9002331](https://brambrinkmeier.com/entra/aadsts/9002331/), [AADSTS9002346](https://brambrinkmeier.com/entra/aadsts/9002346/), [AADSTS9010010](https://brambrinkmeier.com/entra/aadsts/9010010/)

## License and citation

CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). CC BY 4.0 covers the author's own text and classification fields. Quoted Microsoft error wording belongs to Microsoft, is quoted with its source and can change.

Cite as: Bram Brinkmeier, "AADSTS700016: Application not found in the directory", https://brambrinkmeier.com/entra/aadsts/700016/ (CC BY 4.0), last updated 2026-10-30.
