Why the command Get-AzADServicePrincipal showing different Object ID in Portal

Viewed 467

I am trying to get the Service Principal name using the object id. I have used below command

Get-AzADServicePrincipal -ObjectID '7d04df0f-d953-4fac-8b34-fa032b132054'

I got below result enter image description here

When I check this Service Principal in portal, I got same application id but different object id enter image description here

What and why there is difference between these 2 object ID's?

2 Answers

I believe you're mixing 2 things. If I am not mistaken, the screenshot you shared is that of your application (from the App Registration).

An Application's Object Id will always be different than that of the Service Principal.

Please check the Object Id of your Service Principal by going into "Enterprise Applications"

enter image description here

Related