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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

Update datasource API - works fine, but not always

Hi all, I have a problem with 'Datasets - Update Datasource In Group' API. I'm using Azure DevOps pipeline to trigger PowerShell scripts to automaticaly update datasources (DirectQuery) during release. In most cases (let's say 90%) API call for datasource update works fine, so that I know that the request is correct. Unfortunately, sometimes there is no error in API call and everything seems to be ok, but datasource is not updated in PowerBi service. Moreover, in such case I cannot re-call the request due to the following error:

"Dataset doesn't contain a datasource that matches selector #1"

I'm pretty sure that dataset contains a datasource that matches selector #1, it was working 20 seconds earlier. 

In this case I need to re-run my pipeline again (it's mean once again upload a report and update datasource) and everything works like a charm. I need to increase pipeline stability. Do you have any ideas what's going on and what can be a problem?

3 REPLIES 3
jacopoberta
Frequent Visitor

Hi, I have the same issue here. The API always return the error

 

"Dataset doesn't contain a datasource that matches selector #"

 

but I'm sure that the selector should filter a datasource.

How did you fixed this?

Anonymous
Not applicable

That's not the reason. I'm taking over datasets each time I execute script.

lbendlin
Super User
Super User

If I remember correctly you need to re-own a data source after you changed it via API.

 

Reference: Session 02: Writing PowerShell Scripts for Power BI · Power BI Dev Camp (powerappsportals.com)

 

(the topic comes up there)

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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