Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
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?
Solved! Go to Solution.
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:
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
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 Regards
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:
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.
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 Regards
User | Count |
---|---|
15 | |
11 | |
9 | |
7 | |
7 |