I have an Azure Application name and I would like to know if there is a way to get the application ID and other properties of the enterprise application.
I am able to authenticate myself by passing in the clientID/ApplicationID and secret. But, I would like to know if there is a way to fetch client id/application ID using Azure Application name, so that I dont have to hardcode it.
I have one enterprise application named "DemoApp" with below properties:
To fetch client ID (app ID) using application name, you can make use of below commands:
PowerShell:
Connect-AzAccount
$enterpriseApp = Get-AzADServicePrincipal -DisplayName "DemoApp"
$enterpriseApp.AppId
Azure CLI:
az login
az ad sp list --display-name "DemoApp" --query "[0].appId"
Microsoft Graph:
GET https://graph.microsoft.com/v1.0/servicePrincipals/?$filter=displayName eq 'DemoApp' &$select=appId,appDisplayName