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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply

Update Datasource in Paginated report using Power BI

Hi DEVs,

 

I need to update datasource of paginated reports using PBI Dataset from DEV workspace's dataset to PROD workspace's dataset

 

There are 100+ paginated reports and it's hard to update the datasource to PROD dataset everytime deploying to Production workspace

 

Is there's any way I can update programatically using Python or PowerShell?

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi @LakshtSharma99 ,

To change the data source of a paginated report programmatically, you can use the Power BI REST API. Here are the high-level steps you can follow:

  1. Get the report ID of the paginated report you want to modify.
  2. Get the data source ID of the dataset you want to modify.
  3. Modify the connection string of the data source using the Power BI REST API.
  4. Update the data source of the dataset using the Power BI REST API.
  5. Update the report using the Power BI REST API.

Here are some references that can help you with the implementation:

Get the report info:

Reports - Get Reports - REST API (Power BI Power BI REST APIs) | Microsoft Learn

Get the data source:

Datasets - Get Datasources - REST API (Power BI Power BI REST APIs) | Microsoft Learn

Update data source:

Datasets - Update Datasources - REST API (Power BI Power BI REST APIs) | Microsoft Learn

Change data source connection strings with PowerShell - Power BI | Microsoft Learn

Get the report info:

Reports - Update Report Content - REST API (Power BI Power BI REST APIs) | Microsoft Learn

 

Please note that you need to have the necessary permissions to perform these actions. Also, make sure that the data source in the prod environment has the same schema and data as the one in the dev environment.

Best Regards

View solution in original post

Anonymous
Not applicable

Hi @LakshtSharma99 ,

It will only update the data source from DEV environment to PROD environment. You can use Power BI deployment pipelines to clone content from one stage in the deployment pipeline to another, typically from development to test, and from test to production. During deployment, Power BI copies the content from the current stage into the target one. The connections between the copied items are kept during the copy process. Power BI also applies the configured deployment rules to the updated content in the target stage.

You can also deploy content programmatically using the deployment pipelines REST APIs. You can learn more about this process in Automate your deployment pipeline using APIs and DevOps.

The Power BI deployment pipelines process - Power BI | Microsoft Learn

Best practices for deployment pipelines, the Power BI Application lifecycle management (ALM) tool - ...

Best Regards

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @LakshtSharma99 ,

To change the data source of a paginated report programmatically, you can use the Power BI REST API. Here are the high-level steps you can follow:

  1. Get the report ID of the paginated report you want to modify.
  2. Get the data source ID of the dataset you want to modify.
  3. Modify the connection string of the data source using the Power BI REST API.
  4. Update the data source of the dataset using the Power BI REST API.
  5. Update the report using the Power BI REST API.

Here are some references that can help you with the implementation:

Get the report info:

Reports - Get Reports - REST API (Power BI Power BI REST APIs) | Microsoft Learn

Get the data source:

Datasets - Get Datasources - REST API (Power BI Power BI REST APIs) | Microsoft Learn

Update data source:

Datasets - Update Datasources - REST API (Power BI Power BI REST APIs) | Microsoft Learn

Change data source connection strings with PowerShell - Power BI | Microsoft Learn

Get the report info:

Reports - Update Report Content - REST API (Power BI Power BI REST APIs) | Microsoft Learn

 

Please note that you need to have the necessary permissions to perform these actions. Also, make sure that the data source in the prod environment has the same schema and data as the one in the dev environment.

Best Regards

Will it also publish the report to PROD workspace? or just change the datasource in DEV workspace

@LakshtSharma99  is this issue resolved ? Please let me know as I also have to do this.

Anonymous
Not applicable

Hi @LakshtSharma99 ,

It will only update the data source from DEV environment to PROD environment. You can use Power BI deployment pipelines to clone content from one stage in the deployment pipeline to another, typically from development to test, and from test to production. During deployment, Power BI copies the content from the current stage into the target one. The connections between the copied items are kept during the copy process. Power BI also applies the configured deployment rules to the updated content in the target stage.

You can also deploy content programmatically using the deployment pipelines REST APIs. You can learn more about this process in Automate your deployment pipeline using APIs and DevOps.

The Power BI deployment pipelines process - Power BI | Microsoft Learn

Best practices for deployment pipelines, the Power BI Application lifecycle management (ALM) tool - ...

Best Regards

Helpful resources

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

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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