Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Lorenz33
Helper III
Helper III

Need help with extraction Power BI Activity Log data with Fabric Data Factory

I am attempting to use Fabric Data Factory to extract Power BI log data using this documentation: Extracting the Power BI activity log with Data Factory – justB smart and How to Get Activity Data From Power BI Service with REST APIs | phData.  which is for Azure Data Factory. Instead of creating a linked service, with Fabric Data Factory I had to createa new Data Gateway Web2 connection using a Service Principal.

 

In Fabric Data Factory I created a new pipeline and am having problems with the simple Copy Data Activity. I set it up as follows:

 

Lorenz33_0-1725667009507.png

 

For the Relative URL, I do not know what to enter. I have tried /v1.0/myorg/admin/ and /powerbi/api but "Preview Data" still fails.

 

Also, in the instructions for Azure data factory, in the "Copy Data" activity settings. Under source there is the option to add a value for  AdminAPI under DataSet properties. In Fabric Data Factory, under the connection there are no dataset properties. Any help and advice to get this gong would be appreciated.

1 ACCEPTED SOLUTION

I was able to get it working. In the for Azure data factory, in the Copy Events activity in source there is a Dataset properties option where you can add AdminAPI and give it the value:

activityevents?startDateTime='@{formatDateTime(getPastTime(int(item()), 'Day'), 'yyyy-MM-dd')}T00:00:00.000Z'&endDateTime='@{formatDateTime(getPastTime(int(item()), 'Day'), 'yyyy-MM-dd')}T23:59:59.999Z'

In Fabric Data Factory a connection is used instead of a linked service and there is no Dataset properties. What I did to get it working was put the Activity Events content above into the Relative URL section. It worked after that and I retrieved data from the Power BI Activity log.

 

Lorenz33_1-1726243667565.png

 

View solution in original post

4 REPLIES 4
v-kongfanf-msft
Community Support
Community Support

Hi @Lorenz33 ,

 

Maybe you can try below rest api:

GET https://api.powerbi.com/v1.0/myorg/admin/activityevents

Admin - Get Activity Events - REST API (Power BI Power BI REST APIs) | Microsoft Learn

 

Best Regards,
Adamk Kong

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I am using these instructions: Extracting the Power BI activity log with Data Factory – justB smart and How to Get Activity Data From Power BI Service with REST APIs | phData.

 

These instructions say that a pipleline needs to be created that calls the Get Activity Events" REST API with the right set of URI parameters  (startDateTime and endDateTime).

 

The instructions are for Azure Data Factory. I am trying to use Fabric Data Factory. With Azure Data Factory a linked service needs to be created to access the Activity log. With Fabric Data Factory I cannot use a linked service. I successfully created a new connection that uses a service principal that has been allowed to used read-only Power BI admin apis. This permissions was given in the tenant settings. More details on this connection are found here: Solved: Service principal authentication for Web Connectio... - Microsoft Fabric Community

 

A Copy Data activity needs to be created. In Azure Data Factory, for the source section there is an option to choose a source dataset. I believe they chose the linked service. There is also the dataset properties option where an AdminAPI can be added that calls the "Get Activity Events" REST API. In Fabric Data Factory. We cannot use a linked service. As in the picture I posted above, I have to use a connection from which I use the web connection I created that has access to the Power BI Activity log. However, in the Copy Data settings, there is no Dataset properties area under the connection and those no way to add an AdminAPI that calls the "Get Activity Events" REST API. How can this be done?

I was able to get it working. In the for Azure data factory, in the Copy Events activity in source there is a Dataset properties option where you can add AdminAPI and give it the value:

activityevents?startDateTime='@{formatDateTime(getPastTime(int(item()), 'Day'), 'yyyy-MM-dd')}T00:00:00.000Z'&endDateTime='@{formatDateTime(getPastTime(int(item()), 'Day'), 'yyyy-MM-dd')}T23:59:59.999Z'

In Fabric Data Factory a connection is used instead of a linked service and there is no Dataset properties. What I did to get it working was put the Activity Events content above into the Relative URL section. It worked after that and I retrieved data from the Power BI Activity log.

 

Lorenz33_1-1726243667565.png

 

Hi @Lorenz33 ,

 

Thanks for your feedback.

 

Best regards,

Adamk Kong

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

November Update

Fabric Monthly Update - November 2024

Check out the November 2024 Fabric update to learn about new features.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.