Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet 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
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:
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.
Solved! Go to 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.
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.
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
Check out the November 2024 Fabric update to learn about new features.
User | Count |
---|---|
21 | |
15 | |
8 | |
7 | |
6 |