IT Error Decoder

How to Fix Get-MgServicePrincipal not found

Last reviewed

Error message

Get-MgServicePrincipal returns nothing for an app you can see in the portal.

App Registrations and Service Principals are separate objects. A multi-tenant app's registration lives in the publisher's tenant; its service principal only exists in tenants that have consented.

What this error means

The cmdlet succeeded but found no service principal matching your filter. The app exists somewhere — just not as a service principal in the tenant you're connected to.

Why this happens

Most often: looking up by AppId of an App Registration that has never been consented in this tenant (so its service principal doesn't exist locally), or filter quoting is wrong.

Quick fix (for end users)

  • Confirm you're connected to the right tenant.
  • Try filtering by displayName instead of appId.

Admin / engineer fix

  • Look up by both AppId and displayName.

    command
    Get-MgServicePrincipal -Filter "appId eq '<app-id>'"
    Get-MgServicePrincipal -Filter "displayName eq 'My App'"
  • If the app doesn't have a service principal locally, provision one (an admin must do this).

    command
    New-MgServicePrincipal -AppId '<app-id>'
  • Check both v1 and beta endpoints in case the property differs.

Step-by-step fix

  1. Confirm the app's AppId from the portal.

  2. Search by AppId and by displayName.

  3. Provision the service principal if it doesn't exist.

Affected products

Microsoft.Graph.Applications

Common variations of this error

People also see these phrasings of the same problem:

  • Service principal returns nothing
  • Get-MgServicePrincipal empty result

Still broken? Try these

  • Use Find-MgGraphCommand to confirm you have the latest cmdlet syntax.
  • Some apps are hidden from listings until they're consented.

Related errors

Related searches

  • app registration vs service principal
  • microsoft graph powershell list service principals

Frequently asked questions

What's the difference between an App Registration and a Service Principal?

App Registration is the global definition of an app (in the publisher's tenant). Service Principal is the local instance/identity of that app in a specific tenant. A multi-tenant app has one registration but many service principals.

Browse more errors in Microsoft Graph PowerShell: Fix Microsoft Graph PowerShell errors. Insufficient privileges, invalid object ID, missing cmdlets, token problems, and more. Or paste your own error into the error decoder tool to find a match. You can also go back to the homepage to browse common errors by topic.