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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors
Top Kudoed Authors