This is best Fabric, Power BI, SQL and AI community event. How do we know? The last event sold out! Save €200 with code FABCMTY200.
Register nowA new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.
Hi,
I registered app in AAD and enabled Service Principal option in Power BI Admin portal.
So far I can run this cmd let:
$AppId = "AppId"
$TenantId = "TenantId"
$ClientSecret = "ClientSecret"
#Create secure string & credential for application id and client secret
$PbiSecurePassword = ConvertTo-SecureString $ClientSecret -Force -AsPlainText
$PbiCredential = New-Object Management.Automation.PSCredential($AppId, $PbiSecurePassword)
#Connect to the Power BI service
Connect-PowerBIServiceAccount -ServicePrincipal -TenantId $TenantId -Credential $PbiCredential
Get-PowerBIWorkspace -first 5
Get-PowerBIReport -WorkspaceId 666
Get-PowerBIDataset -WorkspaceId 666
AAD app permissions:
But Im not able to run any of MicrosoftPowerBIMgmt.Admin cmd lets. Im expecially interested in Get-PowerBIActivityEvent.
I can run Get-PowerBIActivityEvent with my credentials, but for automation I wanted to use service principal.
Any idea what permissions is service principal missing?
My goal it to run automatically from win scheduler:
Get-PowerBIActivityEvent -StartDateTime $start_day -EndDateTime $end_day
Thanks.
Solved! Go to Solution.
Hi @aaldo_666 ,
Maybe you can refer this guide:
Admin - Get Activity Events - REST API (Power BI Power BI REST APIs) | Microsoft Learn
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @aaldo_666 ,
Maybe you can refer this guide:
Admin - Get Activity Events - REST API (Power BI Power BI REST APIs) | Microsoft Learn
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |