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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Syrine
New Member

Updating connection String of power bi reports using powerShell

Hello, 

I am writing a powerShell Script using the module ReportingServicesTools to automate updating the connection Strings of my PowerBi Reports deployed on PowerBi Report Server. The Script works fine untill the last line which makes the updates on the report server using the function Set-RsRestItemDataSource. The Error is 400 Incorrect Demand. 

All the Echos return what I expect with no problem.

Here is my Script : 

carbon.png

and my Error : 

Capture.PNG

Part of the error is written in French and it says " the server returned an erreur : 400 incorrect demande ".

What I hid in blue is the name of my report.

 

I looked at this link : https://community.powerbi.com/t5/Service/Update-connection-string-via-API/m-p/1850500#M128979 and on the Internet but nothing helped my case.

 

I am using this version of PowerBi Report server : 

Syrine_0-1682699710572.png

and I followed the official Docs : https://learn.microsoft.com/en-us/power-bi/report-server/connect-data-source-apis-pre-oct-2020

I tried another Script with this version of the Docs too but it didn't work for me : https://learn.microsoft.com/en-us/power-bi/report-server/connect-data-source-apis

 

 

I would be glad if you could help me!

0 REPLIES 0

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.