I want to get list of enterprise applications assigned to a user in Azure AD (not servicePrincipals), Is there a direct API to do so, right now I am using below steps to get application details?
Right now,
- I am using
/users/{userId}/appRoleAssignments
API to get servicePrincipals assigned to user and - then doing a call to get application details(application id) of an app using ServicePrincipal API :
/servicePrincipals?$filter=id eq servicePrincipalId-1 or id eq servicePrincipalId-1
. - After these above steps I am getting application details using API :
/applications?$filter=appId eq 'someAppId' or appId eq 'someAppId2'
CodePudding user response:
Enterprise Applications in Azure AD have the service principals associated to them.
When we use graph API to fetch applications assigned to user using /users/{userId}/appRoleAssignments
, will return the service principal id of that enterprise application. It won’t return the application ID.
The steps you are following is the only way to get the application details.