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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Kudoed Authors