I have an application which is registered in Azure (followed this guide). I have the application-id for this application, and I would like to find its object-id by using Azure API (I am using python library). How can I retrieve the object-id?
I have an application which is registered in Azure (followed this guide). I have the application-id for this application, and I would like to find its object-id by using Azure API (I am using python library). How can I retrieve the object-id?
2
Answers
I found that msgraph-core (in preview) can be used for this purpose.
Sample code:
If you need the object id for the service principal, you can use the service principal list endpoint with a filter. https://learn.microsoft.com/en-us/graph/api/serviceprincipal-list?view=graph-rest-1.0&tabs=http
Example filter:
$filter=appId eq 'your-app-id'