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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Charline_74
Helper III
Helper III

API Changing the data source of a dataflow

I would like to know if it is possible to change the data source of a dataflow with an API.

 

For example:

I have a pipeline in which I have a workspace of DEV, TEST and PROD.

And I would like that when I deploy the dataflow on the different environments the data source of the dataflow changes too.

 

For info I use gataway in my dataflow

1 ACCEPTED SOLUTION
Charline_74
Helper III
Helper III

I have found out how to do this and here is the script:

$groupId = ""

 

$dataflowId = ""

 

$dataflowUpdate = "{
    'name' : 'Updated Dataflow Name',
    'description' : 'This is the updated dataflow description'
}"

 


$url = "groups/$groupId/dataflows/$dataflowId"

 

Invoke-powerBIRestMethod -Method Patch -Url $url -Body $dataflowUpdate -ContentType "application/json"

View solution in original post

2 REPLIES 2
Charline_74
Helper III
Helper III

I have found out how to do this and here is the script:

$groupId = ""

 

$dataflowId = ""

 

$dataflowUpdate = "{
    'name' : 'Updated Dataflow Name',
    'description' : 'This is the updated dataflow description'
}"

 


$url = "groups/$groupId/dataflows/$dataflowId"

 

Invoke-powerBIRestMethod -Method Patch -Url $url -Body $dataflowUpdate -ContentType "application/json"
v-shex-msft
Community Support
Community Support

Hi @Charline_74,

I check on the power bi rest API document but not found any Dataflow API suitable to your requirement. Perhaps you can submit an idea for adding support to use rest API change the dataflow data sources.

Microsoft Power BI ideas
Regards,

Xiaoxin Sheng

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

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.