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 Microsoft Entra admin center.

  2. In the left nav blade, select Identity, then Applications, and then select Enterprise applications.

  3. In the Manage section select All applications.

  4. Set a filter for "Application type == Managed Identities" and select Apply.

  5. (Optional) In the search filter box, enter the name of the Azure resource that has system managed identities enabled or the name of the user assigned managed identity.

    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

  • If you prefer to run CLI reference commands locally, install the Azure CLI. If you're running on Windows or macOS, consider running Azure CLI in a Docker container. For more information, see How to run the Azure CLI in a Docker container.

    • If you're using a local installation, sign in to the Azure CLI by using the az login command. To finish the authentication process, follow the steps displayed in your terminal. For other sign-in options, see Sign in with the Azure CLI.

    • When you're prompted, install the Azure CLI extension on first use. For more information about extensions, see Use extensions with the Azure CLI.

    • Run az version to find the version and dependent libraries that are installed. To upgrade to the latest version, run az upgrade.

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 example scripts, you can run scripts locally by installing the latest version of Azure PowerShell, then sign in to Azure using Connect-AzAccount -Environment AzureChinaCloud.

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.