0
votes

I need to receive list of user's subscriptions using service principal.

For user which has token now it's easy - A GET call to https://management.azure.com/subscriptions?api-version=<API_version>

But how is ti possible for any user in Azure AD, if my service principal has enough permissions in Azure AD?

Thanks in advance!

1
Any other concerns about this issue?Joy Wang-MSFT

1 Answers

0
votes

You could not use the service principal to get the user's subscriptions(i.e. the subscriptions that the user can access in one tenant) via this REST API.

When you use the REST API Subscriptions - List, it will make the request depends on the access token passed, if you use the service principal to get the token, you can just get the subscriptions that the service principal can access, not the user.

In this case, your option here is to use the auth code flow or implicit grant flow(the Try it button in the doc use it, not recommended) to get the token, then use the token to call the REST API to list the subscriptions that the user can access.