Forum Discussion
Using Powerbi Service "Usage Metrics Report" as a datasource for Databricks for further processing
- 1 year ago
Hi BiancaCiui , Thank you for reaching out to the Microsoft Community Forum.
First, head to Azure Portal -> App Registrations -> your app -> API Permissions. Add ActivityEvent.Read.All for the Activity Events API and grant admin consent via your tenant admin. This permission is essential for admin-level activity data access (you can add Workspace.Read.All later if you pivot to Usage Metrics Reports).
Next, in Power BI Admin Portal -> Tenant Settings, enable “Allow service principals to use Power BI APIs” and add your App Registration’s service principal. You can find the service principal in Azure Portal -> Enterprise Applications. Then, in Azure AD, assign it the Power BI Service Administrator role, critical for the Activity Events API. This links your app to Power BI without a “subscription connection,” just pure authentication.
Now, in your Databricks notebook, use the client ID, client secret, and tenant ID to generate an access token. Use that token to call the Activity Events API.
If this helped solve the issue, please consider marking it 'Accept as Solution' so others with similar queries may find it more easily. If not, please share the details, always happy to help.
Thank you. - 1 year ago
Hi BiancaCiui , Thank you for reaching out to the Microsoft Community Forum.
Yes, a Pro license alone isn’t enough to unlock the full Power BI Admin Portal, including Tenant Settings. You need Premium or Fabric capacity in your tenant, not just in a single workspace. This is required for admin features like enabling service principal API access.
Tenant Settings are hidden unless you’re a Power BI Service Administrator and your tenant has Premium capacity. Your Pro license lets you build reports, but admin-level controls like “Allow service principals to use Power BI APIs” require that extra capacity.
You need Workspace.ReadAll scope.
NOTE: Usage Metrics Reports are limited to individual workspaces. You would need to repeat the process for each of your workspaces. Consider using the Tenant Audit logs instead.