The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
My team and i want to use "Usage Metrics Report" generated by powerbi service as a datasource for a Databricks notebook. We want to further process this utilization data.
On this topic I found the documentation on the Activity Events API - https://learn.microsoft.com/en-us/rest/api/power-bi/admin/get-activity-events, which could be used to extract this utilization data and then connecting the databricks notebook to this API.
We don't have an Azure App Registration connected to our PowerBI Service in any way, we just use the standalone PowerBI Service, while also having an Access Connector for Azure Databricks.
The problem is that i cannot connect to the Activity Events API from databricks, i don't know what permissions i need for this purpose.
My understanding of the problem is that i need to create an App Registration (connected somehow to my subscription in powerbi service) and access the Powerbi API activity data through this app registration in Databricks, using the tenant and client_id and client_secret. But i do not know how to connect the Azure App Registration to PoertBI Service subscription. Could you please help me?
Solved! Go to Solution.
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.
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.
Hi @BiancaCiui , Please let us know if your issue is solved. If it is, consider marking the answer that helped 'Accept as Solution', so others with similar queries can find it easily. If not, please share the details.
Thank you.
Hi @BiancaCiui , Please let us know if your issue is solved. If it is, consider marking the answer that helped 'Accept as Solution', so others with similar queries can find it easily. If not, please share the details.
Thank you.
Hi @BiancaCiui , Please let us know if your issue is solved. If it is, consider marking the answer that helped 'Accept as Solution', so others with similar queries can find it easily. If not, please share the details.
Thank you.
Thank you for your quick response!
So what i have for now are the following: PowerBI workspace that generates "Usage Metrics Report" data about our users, an Azure App Registration where i set up "Workspace.Read.All" API permissions, (having a tenant and client id and client secret for the App Registration), and a Databricks workspace.
I know that Databricks notebooks can connect to the Azure App Registration via token created with cliend_id and secret.
How can i connect the App Registration to the existing Powerbi workspace/admin so that i can access that data in Databricks using the client id and secret? There is no connection between App Registration and Powerbi.
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.
The solution seems correct based on my understanding of the problem, but for now i cannot see anything in PowerBI Admin Portal (missing Tenant Settings, enable “Allow service principals to use Power BI APIs”). I do have a Pro license attached to my account, but does it require a Premium license for the workspace (i don't have that)? In the meantime i reached out to my Global Administrator so they would assign me Power BI Service Administrator role, since i cannot do that myself.
Once i get the role, i'll come back and accept the answer as a solution. Thank you!
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.
Next step is to execute queries against the usage report dataset in that workspace via the Power BI REST API.
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.