Forum Discussion
I’m trying to programmatically retrieve Power BI report subscription details using the Admin API end
- 1 year ago
Thanks for information, The Admin API worked when we "Enable service principal to access powerbi API" and Application permission in Azure portal for PowerBI service should not have Application based permission. Worked for me after I revoked admin consent for below permission.
--->Tenant.Read.All(Should not be Application type and Revoke admin consent)
Hello ajaynathreddy
Possible issue
Even with Tenant.Read.All, the 401 error occurs because Admin APIs require the app to be a Power BI Admin or have delegated user context — and application permissions alone won't work unless the service principal is granted Fabric admin rights.
Solution
Ensure the service principal is explicitly added as a Power BI Service Administrator in the Microsoft 365 Admin Center or is assigned Fabric (Power BI) Admin role via Azure AD. Without this, even with the correct API scopes, GET /admin/reports/{reportId}/subscriptions will return 401.
Thanks
If this solution helps, please accept it and give a kudos (Like), it would be greatly appreciated.
In powerbi admin portal, enabled service principal to access powerbi admin API and added a security group which has app as
member, does this permission not enable admin role for the application. Still do we need explicitely assign powerbi service admin role to the app in azure AD. Thank you for responding faster.
- Akash_Varuna1 year ago
Super User
Hi ajaynathreddy Ensure the app has the Power BI Service Admin role explicitly assigned in Azure AD, as adding it to a security group alone doesn’t grant this role. Verify that the security group is enabled for API access in the Power BI Admin Portal. Double-check the Tenant.Read.All permission with admin consent. Retry the API call using a valid token with the appropriate scope.
- ajaynathreddy1 year agoNew Member
Yes I can confirm the security group is enabled to access the admin api in powerbi admin portal, and in azure ad given application permissions: Tenent.Read.All(both application and delegated type) and Tenent.ReadWrite.All(Application type) with admin consent granted. But did not give the application powerbi service admin role via Azure AD. I will ask my admin for it. Thanks.