View the service principal of a managed identity

Managed identities for Azure resources provide Azure services with an automatically managed identity in Microsoft Entra ID. You can use this identity to authenticate to any service that supports Microsoft Entra authentication without having credentials in your code.

In this article, you'll learn how to view the service principal of a managed identity.

Note

Service principals are enterprise applications.

Prerequisites

View the service principal for a managed identity using the Azure portal

  1. Sign in to the Azure portal.

  2. In the search box, Enter Microsoft Entra ID. Under Services, Select Microsoft Entra ID and then select Enterprise applications.

  3. Under Application Type, choose All Applications and then select Apply.

  4. In the search filter box, type the name of the Azure resource that has managed identities enabled or choose it from the list.

    Screenshot of the View managed identity service principal.

Next steps

For more information about managed identities, see Managed identities for Azure resources.

View the service principal of a managed identity using Azure CLI

The following command demonstrates how to view the service principal of a virtual machine (VM) or application with managed identity enabled. Replace <Azure resource name> with your own values.

az ad sp list --display-name <Azure resource name>

Next steps

For more information on managing Microsoft Entra service principals, see Azure CLI ad sp.

View the service principal for a managed identity using PowerShell

To run the scripts for this example, you have two options:

  • Use the Azure Cloud Shell, which you can open using the Try It button on the top right corner of code blocks.
  • Run scripts locally by installing the latest version of Azure PowerShell, then sign in to Azure using Connect-AzAccount.

The following command demonstrates how to view the service principal of a virtual machine (VM) or application with system assigned identity enabled. Replace <Azure resource name> with your own values.

Get-AzADServicePrincipal -DisplayName <Azure resource name>

Next steps

For more information on viewing Microsoft Entra service principals using PowerShell, see Get-AzADServicePrincipal.