Forum Discussion
Connection String for Embedded report which uses DirectQuery
I have a PBIX which uses a Direct Query to a SQL Azure database. I have followed the steps in https://azure.microsoft.com/en-gb/documentation/articles/power-bi-embedded-get-started-sample to create a workspace etc and get to the point where it states "...run option 7 to update the connection strings". The downfall seems to be the connection string itself; I have tried 'xxxx.database.windows.net: databasename' or 'Server=xxxx.database.windows.net; Database=databasename'.
What is the correct format for the connection string?
Yes that will work as it retains the connection string from the .pbix file you upload. If you want to programmatically change the connection string (e.g. to switch between DEV/TEST/LIVE) then I believe this should help?
https://msdn.microsoft.com/en-us/library/azure/mt711505.aspx
11 Replies
- Infero
Advocate I
Hey, I also am having a problem here, just wondering, did you find the right format ? or a workaround ?
- gjross
Advocate II
I built a new workspace and ran the project again, this time, when running Option 7, I only updated the username and password. I hit enter to skip updating the connection string - and it worked.
- Brian_M
Continued Contributor
Yes that will work as it retains the connection string from the .pbix file you upload. If you want to programmatically change the connection string (e.g. to switch between DEV/TEST/LIVE) then I believe this should help?
https://msdn.microsoft.com/en-us/library/azure/mt711505.aspx
- gpanagakisNew Member
This tutorial How to use Power BI Embedded with REST helped me set the credential for my datasource. I was not able to set them using the option 7 of the provision example, I used a Rest client like PostMan and followed the article specifically the part in "Data Source Connectivity (and multi-tenacy of data)".
You can see the format of the connection string in the article.
- gpanagakisNew Member
A very useful article is How to use Power BI Embedded with REST under the heading "data source connectivity" I found
very useful info how to set connection strings and set credential to the datasource. I could not make it using the provisioning sample option 7 and following the articles advise I used a rest client like PostMan and send the requests,
Hope I helped!
- sundarNew Member
While designing the report use Direct query method instead of Import in Power BI desktop.
And then import the Pbix file using Provisionsample command line .
Finally update the dataset using the following connection string format:
"Data Source=xxxx.database.windows.net;Initial Catalog=dbname;User ID=xxx;Password=xxxx;"
It worked well for me. Hope it will help.
Thank you.