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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
DavidPi
Helper II
Helper II

API - Update Datasources In Group for Paginated Reports - Unauthorized

Hello,

 

I try to update RDL report data source via API (using service principal).

 

{
"updateDetails": [
{
"datasourceName": "JIRADB",
"connectionDetails": {
"server": "SQLBIP1DP1",
"database": "COGNOS_REPORTING"
}
}
]
}

 

And I receive this return message:

 

{
"error": {
"code": "Unauthorized",
"message": "Update datasource JIRADB is unauthorized"
}
}

 

I can not find solution. Service principal is admin in workspace. 

But I can not set service principal as owner on data gateway data source (error msg no email address) - is this the problem?

1 ACCEPTED SOLUTION

I found the solution - You first need to call take over API - Reports - Take Over In Group - REST API (Power BI Power BI REST APIs) | Microsoft Learn. Then You can call API to change data source. 

View solution in original post

6 REPLIES 6
DavidPi
Helper II
Helper II

Our paginated reports are directly from Oracle (through data gateway). Maybe this API can be used to rebind dataset - Reports - Rebind Report In Group - REST API (Power BI Power BI REST APIs) | Microsoft Learn.

But we didn"t test this.

v-shex-msft
Community Support
Community Support

Hi @DavidPi,

AFAIK, update dataset should work for power bi reports. If you are work with RDL files, please try to use the update data source API if helps:

Reports - Update Datasources In Group - REST API (Power BI Power BI REST APIs) | Microsoft Learn

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

I found the solution - You first need to call take over API - Reports - Take Over In Group - REST API (Power BI Power BI REST APIs) | Microsoft Learn. Then You can call API to change data source. 

thanks - I'll give it a try

hello @DavidPi Thanks for these great info'! Does this also work for a paginated report that point to a PBI dataset - assuming old and new pbi dataset are in different workspace?

Yes, I use this API, but receive message - Update datasource JIRADB is unauthorized.

I do not know which permision I should have more. In Doc I see - 

  • The user must be the data source owner

What does this mean? How to set owner of data source in RDL? I am confused.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Kudoed Authors