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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
williamd
New Member

Update Connection Strings via API

I have been using the Rest API to publish PBIX files to PowerBI.com. Part of this process was setting the connection strings to the production instance. I struggled with the documentation, as we are using an on-premise data source with the enterprise gateway.

 

I spent many hours troubleshooting why i was getting an error 

1 ACCEPTED SOLUTION
williamd
New Member

I have been using the Rest API to publish PBIX files to PowerBI.com. Part of this process was setting the connection strings to the production instance. The documentation doesnt say much around using an on-premise data source with the enterprise gateway.

 

I spent many hours troubleshooting why i was getting this error

 

 powerbi issue.png

 

 

 The example connectionstring that is used is this:

"data source=MyAzureDB.database.windows.net;initial catalog= Sample2;persist security info=True;encrypt=True;trustservercertificate=False"

 

I couldnt get that to work, i got it to work using the following format:

 

"data source=mylocaldbinstance;initial catalog=localdb;persist security info=False" .

 

Hopefully this helps others who get stuck on this.

View solution in original post

4 REPLIES 4
williamd
New Member

I have been using the Rest API to publish PBIX files to PowerBI.com. Part of this process was setting the connection strings to the production instance. The documentation doesnt say much around using an on-premise data source with the enterprise gateway.

 

I spent many hours troubleshooting why i was getting this error

 

 powerbi issue.png

 

 

 The example connectionstring that is used is this:

"data source=MyAzureDB.database.windows.net;initial catalog= Sample2;persist security info=True;encrypt=True;trustservercertificate=False"

 

I couldnt get that to work, i got it to work using the following format:

 

"data source=mylocaldbinstance;initial catalog=localdb;persist security info=False" .

 

Hopefully this helps others who get stuck on this.


@williamd wrote:

I have been using the Rest API to publish PBIX files to PowerBI.com. Part of this process was setting the connection strings to the production instance. The documentation doesnt say much around using an on-premise data source with the enterprise gateway.

 

I spent many hours troubleshooting why i was getting this error

 

 powerbi issue.png

 

 

 The example connectionstring that is used is this:

"data source=MyAzureDB.database.windows.net;initial catalog= Sample2;persist security info=True;encrypt=True;trustservercertificate=False"

 

I couldnt get that to work, i got it to work using the following format:

 

"data source=mylocaldbinstance;initial catalog=localdb;persist security info=False" .

 

Hopefully this helps others who get stuck on this.


Great to hear you could finally get this to work, was the API Set All Connections called in your case?

Hi,

 

I am trying the similar thing. Using Import API I have imported set of PBIX files to PBI Service. Now I would need to update the connection string for all the imported ones. Connection string varies for different App workspace. 

williamd
New Member

I have been using the Rest API to publish PBIX files to PowerBI.com. Part of this process was setting the connection strings to the production instance. I struggled with the documentation, as we are using an on-premise data source with the enterprise gateway.

 

I spent many hours troubleshooting why i was getting this error, after following the apery sample:

 

 powerbi issue.png

 

 

 

"data source=MyAzureDB.database.windows.net;initial catalog= Sample2;persist security info=True;encrypt=True;trustservercertificate=False"

 

 

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.

Top Solution Authors