cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tanako1991 Regular Visitor
Regular Visitor

Re: Powershell script to change Datasource Test to Production

This maybe be a stupid question (powershell noob) but how do i do this for example if i have a folder named 'mypowerbifolder' where i have 20 pbix files in C:\Users\Tanako123\Documents\mypowerbifolder and want to run this script for all my pbix files in this folder. 

I tried to google this how to do this, which should be pretty easy i think but i couldnt understand the logic

it should be a combination of get-childitem and for each? 

thanks in advance!

cchen407etr Occasional Visitor
Occasional Visitor

Re: Powershell script to change Datasource Test to Production

I've tried the powershell script mentioned in this thread but I will always get a 400 bad request.

 

I've also tried using the API (https://app.swaggerhub.com/apis/microsoft-rs/PBIRS/2.0#/PowerBIReports/UpdatePowerBIReportDataSource) and will also get 400 bad request if I touch the connection string.

 

If anyone has any other ideas, I'm open to trying as in my organization we have multiple environments I would like to deploy to automatically.

imichalarias Frequent Visitor
Frequent Visitor

Re: Powershell script to change Datasource Test to Production

Is there any solution to this problem? We are trying to edit a PBIRS DataSource connecting to an on-premise SQL Server database, using the UpdatePowerBIReportDataSource method.

 

No matter what we edit (database name, server or user), we get a 400 bad request...

 

Our PBIRS is 15.0.1102.371 (Mai 2019).

bhanson41 Member
Member

Re: Powershell script to change Datasource Test to Production

To my knowledge, it is only possible with SSAS-based sources. It's certainly not possible with SQL Server databases.

 

You're able to attempt this with your report by: "Manage"-->"Data sources"-->"Connection string". Try to edit the connection string. It's possible in SSAS but nothing else I've ran into.

imichalarias Frequent Visitor
Frequent Visitor

Re: Powershell script to change Datasource Test to Production

@bhanson41thanx for the quick reply! I have no clue (and no understanding) why this function is limited to SSASconnections only... What were they thinking??? Let's hope it is going to be fixed soon...

Helpful resources

Announcements
Back to School Contest

Back to School Contest

Engage and empower students with Power BI!

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Summit Australia 2019

Summit Australia 2019

Travel to Melbourne and network with thousands of peers!

PBI Community Highlights

PBI Community Highlights

Check out what's new in the Power BI Community!

Top Ideas
Users Online
Currently online: 105 members 1,398 guests
Please welcome our newest community members: