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
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.