Last February Microsoft announced that its possible to authenticate with service principal.
This allows you to perform operations on the REST API without an actual user account (master account) or a Power BI PRO license assignment.
Learn here on how to create the Service Principal and configure it to use in your Power BI Tenant. In resume the steps are:
- Register an App in Azure AD
- Create a Security Group and add the App as a Member
- Enable Service Principals to use the Power BI APIs and add the Security Group above
- Add the App to the workspace as Admin
Regarding PowerBIPS to use a Service Principal you should get the token using the following code:
$tenantId = "MyTenant.onmicrosoft.com" $clientId = "Application Id" $clientSecret = "Application Secret" $authToken = Get-PBIAuthToken -clientId $clientId -clientSecret $clientSecret -tenantId $tenantId
With the token you can call any of the cmdlets like this:
$reports = Get-PBIReport -authToken $authToken -groupId "Workspace id"
Note: Service Principals are only supported over new Power BI Workspace model and doesn’t work with admin APIs