I'm building an AD multi-tenant app and in order to get the data regarding who is assigned to what role within their tenant, I need to query an endpoint that requires a service principal ID. This ID is unique per tenant and I'm trying to fill it in the API link dynamically, just not sure where to get this per tenant.
The API endpoint I'm trying to query:
https://graph.windows.net/{ tenantID }/servicePrincipals/{ service Principal ID to be inserted }/appRoleAssignedTo?api-version=1.6
I've been looking through documentation all day but I can't seem to find a way to get this in a dynamic way per tenant.