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.
Hi I want to use Rest Api to get Activity events for last day. I have registered an app + AAD Group. Add group to API permisions in admin portal and set up permissions for the app registration like this:
Tested in Powershell.
But still all I can do is list of workspaces where AAD Group is admin.
$rest = Invoke-PowerBIRestMethod -Url "https://api.powerbi.com/v1.0/myorg/groups" -Method Get | ConvertFrom-Json
I even cannot list reports inside one of those workspaces.
$rest = Invoke-PowerBIRestMethod -Url "https://api.powerbi.com/v1.0/myorg/reports/XXXXXXXXXXXXXXXXXXXXXXXXX" -Method Get | ConvertFrom-Json
In powershell version I get error Operation returned an invalid status code 'Forbidden'
My goal is to run this code in Data Factory to store it in sql server
Invoke-PowerBIRestMethod -Url "https://api.powerbi.com/v1.0/myorg/admin/activityevents?StartDateTime='2022-09-23T08%3A55%3A00.000Z'&EndDateTime='2022-09-23T10%3A55%3A00.000Z'"
Any advise what Im doing wrong?
Thanks.
Can you please confirm on the below aspect :
When running under service prinicipal authentication, an app must not have any admin-consent required premissions for Power BI set on it in the Azure portal.
https://learn.microsoft.com/en-us/rest/api/power-bi/admin/get-activity-events