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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
castrom
Frequent Visitor

Change data source connection strings in Power BI reports with PowerShell

Hi,

 

I'm trying to automate PowerBI reports deployment using Azure Pipelines and PowerShell.

I am able to connect to PowerBI using Connect-PowerBIServiceAccount and a service principal.

I also can list workspaces and existing reports.

 

My next task is to change the data source connections. I have been following this MS documentation https://learn.microsoft.com/en-us/power-bi/report-server/connect-data-source-apis but when I try the following:

 
# Get report parameters
$parameters = Get-RsRestItemDataModelParameters '/Infusion_Model_Auto'
 
I get this error:
 
Failed to create a new session to http://localhost/reports/api/v2.0/me :
| The cmdlet cannot protect plain text secrets sent over unencrypted
| connections. To suppress this warning and send plain text secrets over
| unencrypted networks, reissue the command specifying the
| AllowUnencryptedAuthentication parameter.
I'm not sure what's going on, since I already have an active connection.
 
Thanks for any help.
1 ACCEPTED SOLUTION
v-jtian-msft
Community Support
Community Support

Hi, lbendlin .Thanks for your concern about this issue.

Your answer is excellent!
And I would like to share some additional solutions below.
Hello,@castrom .I am glad to help you.
It looks like you are trying to implement a report data source change on Power BI Service (not Report Server)
Hopefully the following API link will help you out
URL:
Gateways - Update Datasource - REST API (Power BI Power BI REST APIs) | Microsoft Learn
 

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

Best Regards,

Carson Jian,

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.




View solution in original post

3 REPLIES 3
v-jtian-msft
Community Support
Community Support

Hi, lbendlin .Thanks for your concern about this issue.

Your answer is excellent!
And I would like to share some additional solutions below.
Hello,@castrom .I am glad to help you.
It looks like you are trying to implement a report data source change on Power BI Service (not Report Server)
Hopefully the following API link will help you out
URL:
Gateways - Update Datasource - REST API (Power BI Power BI REST APIs) | Microsoft Learn
 

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

Best Regards,

Carson Jian,

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.




castrom
Frequent Visitor

Hi @lbendlin ,

I think I just realised that the instructions here are for a PowerBI on prem setup.
We are using the PowerBI app in Azure, so I don't think we have a PowerBI Reports Server.
I will try another approach now, by using the PowerBI Rest APIs.

Thanks for coming back to me though.

lbendlin
Super User
Super User

Please confirm if you indeed are attempting to do this for Power BI Report Server.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.