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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

rebind report with service principal by using PowerBI REST API

Hello all, 

 

I'm struggling trying to rebind report connected to dataset (livequery) with a service principal.

Here is the powershell code : 

 

$ApiReBindToDatasetRequestBody = @"
{
"datasetId": "$RebindDatasetId"
}
"@

 

$ApiReBindToDatasetUrl="https://api.powerbi.com/v1.0/" + $TenantId + "/groups/" + $WorkspaceObject.Id + "/reports/" + $ReportId + "/Rebind"

Invoke-PowerBIRestMethod -Url $ApiReBindToDatasetUrl -Method POST -Body ("$ApiReBindToDatasetRequestBody")

 

It throws me a 404 not found.

TarikGuetarni_0-1633283190699.png

 

the code works perfectly fine with an identified user.

 

Prior to this code, these are the following steps :

- Publish report connected live to one dataset

- Take owner of the second dataset (the service principal has been added to the workspace where the second dataset is)

- Update parameter and link to gatewat the second dataset.

- Rebind API call to 'connect' the report to the second dataset.

The last step doesnt work with a service principal although i've added all possible permissions on Azure.

 

Help please (i've trying also to delete the report with the service principal and no success, it seems like the service principal cannot interact with the report maybe only datasets)

1 REPLY 1
Anonymous
Not applicable

Hi @Anonymous 

You can refer to the link below to find a suitable method to solve your problem .

https://docs.microsoft.com/en-us/rest/api/power-bi/datasets

 

Best Regards

Community Support Team _ Ailsa Tao

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.