Skip to main content
Microsoft 365intermediate

AADSTS700016: Application Not Found in the Directory or Tenant

Fix AADSTS700016 — the application wasn't found in the directory/tenant. Causes: app never consented, wrong tenant in the authority URL, or a bad client ID.

8 min readUpdated August 2026

AADSTS700016 — "The application wasn't found in the directory/tenant" means Entra ID searched the tenant your sign-in request named and found no such application. This guide covers the three documented causes, how to tell which one you have, and the fix for each.

The Error

AADSTS700016: Application with identifier '<client-id>' was not 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 may have sent your authentication request
to the wrong tenant.

Microsoft's internal name for the code is UnauthorizedClient_DoesNotMatchRequest.

The message is unusually informative — it names both the application identifier that was searched for and the tenant that was searched. Note both before you do anything else.

Why This Happens

Microsoft documents three causes:

  1. The application has not been installed by an administrator of the tenant.
  2. No user in the tenant has consented to it, so no service principal exists there.
  3. The request carried the wrong identifier — a misconfigured client ID, or an authentication request sent to the wrong tenant.

Underneath all three sits one concept. An app registration is the definition of an application and lives in exactly one tenant. A service principal is that application's local presence in a tenant, and one is created when the app is installed or consented to there. AADSTS700016 means no service principal exists in the tenant that was searched.

The application can be perfectly healthy and still produce this error, because the problem is where it was looked for.

If You're a User (Not an Admin)

Nothing you can do from your side changes this — it is a configuration problem, not a credential one. Retrying, clearing cookies, and switching browsers all fail identically.

Send your administrator:

  • The full error text, including the client ID and tenant it names
  • The application you were opening and the account you used
  • The Request ID and timestamp from the error page

The client ID and tenant in the message are what your admin needs; do not paraphrase the error.

Diagnose Which Cause You Have

Do this before applying any fix. Two minutes here saves an hour.

Step 1: Read the tenant in the error. Does the tenant GUID or domain in the message match the organization you meant to sign in to? If not, you have cause 3 — go to Fix 3.

Step 2: Look for the app in your tenant.

  1. Microsoft Entra admin center → IdentityApplicationsEnterprise applications
  2. Change Application type to All applications
  3. Search for the client ID from the error message

If it appears, the app is in your tenant, and your problem is the identifier or authority in the request — again Fix 3. If nothing is returned, continue.

Step 3: Check whether it was deleted. Go to App registrationsDeleted applications. A recently deleted registration can usually be restored, which is far quicker than rebuilding it with all its reply URLs and permissions.

Step 4: If it was never there, you have cause 1 or 2 — install it or consent to it.

Fix 1: Install the Application in the Tenant

Requires: Cloud Application Administrator, Application Administrator, or Global Administrator.

For a gallery application:

  1. Entra admin center → IdentityApplicationsEnterprise applications
  2. New application
  3. Find the app in the gallery and add it
  4. Configure single sign-on and assign users

Adding the application creates the service principal, which is the thing that was missing.

Advertisement

Requires: Privileged Role Administrator or Global Administrator for tenant-wide consent.

If the app exists as a registration but has never been consented to in the tenant:

  1. Entra admin center → IdentityApplicationsEnterprise applications → the app
  2. Permissions
  3. Grant admin consent for <your organization>
  4. Review what is being granted, then confirm

For a third-party or multitenant app you do not yet have, the vendor can supply an admin consent URL of the form https://login.microsoftonline.com/{tenant}/adminconsent?client_id={client-id}. Opening it as an administrator creates the service principal in your tenant.

Read the permission list before consenting. Admin consent grants the requested permissions for every user in the tenant, and over-permissioned applications are a genuine security problem. If an app asks for more than its function needs, that is a conversation with the vendor, not a checkbox.

Fix 3: Correct the Client ID or Authority URL

This is a developer or vendor fix, not a directory one.

Check the client ID. Compare the identifier in the error message against the Application (client) ID on the app registration's Overview page. A single wrong character produces exactly this error.

Check the authority URL. The tenant segment decides which directory gets searched:

https://login.microsoftonline.com/{tenant}/oauth2/v2.0/authorize
{tenant} valueSearches
A tenant GUID or domainThat specific tenant only
organizationsAny work or school tenant
commonWork, school, or personal Microsoft accounts
consumersPersonal Microsoft accounts only

A single-tenant app registration pointed at a different tenant GUID fails with AADSTS700016 every time, and the app looks completely fine in its home tenant while it does so. Developers testing against a customer tenant hit this constantly.

If the app genuinely needs to serve multiple organizations, change its supported account types on the registration to a multitenant option — and understand that each customer tenant still needs consent before their users can sign in.

Verify the Fix

  1. Confirm the service principal exists. Enterprise applications, filtered to all application types, searched by client ID — it should now return the app.
  2. Sign in again from a private browser window to avoid a cached failed state.
  3. Check the sign-in logs. Entra admin center → MonitoringSign-in logs, filtered to the user. The entry should now succeed, or fail with a different code — which is progress, and usually AADSTS50105 next.

Prevent It Coming Back

  • Never delete an enterprise application to "clean up" without confirming nothing authenticates through it. This error is a common aftermath.
  • Keep client IDs in configuration, not in code, so a wrong environment cannot ship a wrong ID.
  • Use organizations rather than a hard-coded tenant GUID for apps that serve more than one customer.
  • Document the consent step in your onboarding runbook if you publish a multitenant app — most "your app is broken" reports from new customers are an ungranted consent.
  • Review app registrations before they expire or are cleaned up. An orphaned registration removed during a tidy-up takes every integration using it down with it.
CodeMeaningDifferent because
AADSTS50105The signed-in user isn't assigned to a role for the appThe app is present; your account is not assigned
AADSTS53003Access blocked by Conditional AccessA policy blocked it; the app exists fine
AADSTS650057Invalid resource — the client requested a resource not listed in its permissionsPermission configuration, not app presence

For scripted inspection of service principals and consent grants, connect with the Microsoft Graph PowerShell module; the module install and connection pattern is the same one covered in how to install and connect to Exchange Online PowerShell.

Frequently Asked Questions

Find answers to common questions

It means Microsoft Entra ID looked for the application in the tenant the sign-in request was sent to and could not find it. Microsoft's internal name for the code is UnauthorizedClient_DoesNotMatchRequest. There are three documented causes: an administrator never installed the application in the tenant, no user ever consented to it, or the request carried the wrong identifier — a mistyped client ID, or the wrong tenant in the authority URL.

Because it exists somewhere else. An app registration lives in one tenant; using it against a different tenant requires a service principal in that second tenant, created by installation or consent. Developers hit this constantly when their sign-in URL points at their own tenant GUID while testing against a customer tenant, or the reverse. The app is real — the tenant in the request is wrong.

You cannot. This is a configuration problem in the application or the directory, not something you did. Send your administrator the full error text including the code, the application you were opening, the account you used, and the Request ID and timestamp shown on the error page. Retrying, clearing cookies, or using another browser will not change the outcome.

AADSTS700016 means the application was not found in the tenant at all. AADSTS50105 means the application is there but your account is not assigned to it. Reading the code carefully saves real time — the first is fixed by installing or consenting to the app, the second by adding a user or group to its assignment list. They are not interchangeable.

In the Microsoft Entra admin center go to Identity, Applications, Enterprise applications, change the filter to show all application types, and search for the app by name or client ID. Enterprise applications lists service principals — the local presence of an app in your tenant. If nothing is returned for the client ID in the failing request, the app genuinely is not there and that is your answer.

Everything. The sign-in URL contains the tenant the request is aimed at — either a GUID, a domain, or one of the shortcuts common, organizations, or consumers. Point a single-tenant app at the wrong tenant GUID and Entra ID searches the wrong directory and correctly reports that the application is not there. Checking the URL is the fastest diagnostic step available.

It does when the cause is that the app has never been consented to in your tenant, which is one of the three documented causes. Granting admin consent creates the service principal that represents the app locally, and the error stops. It does not help if the client ID is simply wrong or the request is aimed at the wrong tenant — verify which cause you have before granting consent to anything.

Installing an application or granting tenant-wide admin consent requires Cloud Application Administrator, Application Administrator, or Global Administrator. Correcting a client ID or authority URL is a developer or vendor task, not a directory one. Work out which of the three causes applies first, because it decides who you need.

Yes. If the app registration or its service principal was deleted, every sign-in that references that client ID fails this way. Check the deleted items view under App registrations in the Entra admin center — recently deleted registrations can often be restored, which is far less work than recreating the app and reconfiguring every reply URL and permission.

Because each customer tenant needs its own service principal for your app, created the first time someone installs it or consents to it there. Until that happens the app does not exist in their directory. Send the customer administrator an admin consent URL for their tenant, or have them add the app from the gallery, and the error resolves on first consent.