Reply
Frequent Visitor
Posts: 4
Registered: ‎12-06-2016

Re: PowerBI Embedded Sample Connection string

Please use a "Direct query" option (not import) when you are building the .pbix file. Once you do this deploy using option 6 then use the option 7 to update the connection string.

 

use the connection string in below format

 

"Data Source=xxxx.database.windows.net;Initial Catalog=dbName;User ID=xxx;Password=xxx;"

 

Note : this will work only for Sql server (not sure for other servers)

 

Regards

Sai 

Frequent Visitor
Posts: 4
Registered: ‎12-06-2016

Re: PowerBI Embedded Sample Connection string

Please use a "Direct query" option (not import) when you are building the .pbix file. Once you do this deploy using option 6 then use the option 7 to update the connection string.

 

use the connection string in below format

 

"Data Source=xxxx.database.windows.net;Initial Catalog=dbName;User ID=xxx;Password=xxx;"

 

Note : this will work only for Sql server (not sure for other servers)

 

Regards

Sai 

 

Visitor
Posts: 1
Registered: ‎12-08-2016

Re: PowerBI Embedded Sample Connection string

Finally made it to work after the following instruction from below link.

http://stackoverflow.com/questions/37919757/power-bi-embedded-change-connection-string-for-direct-qu...

Frequent Visitor
Posts: 2
Registered: ‎10-20-2016

Re: PowerBI Embedded Sample Connection string

Did you ever figure out how to solve the problem?  I am doing the same thing with the same result.

Member
Posts: 124
Registered: ‎04-21-2016

Re: PowerBI Embedded Sample Connection string

[ Edited ]

I updated the credentials and got a message "Connection information updated successfully".

But when i open the web app it says "Can't display the visual'.

 

Do I need to make changes to the EmbedSample code?

 

vth Frequent Visitor
Frequent Visitor
Posts: 2
Registered: ‎02-06-2017

Re: PowerBI Embedded Sample Connection string

[ Edited ]

I have solved the problem by adding the credentials (bold) to EmbedSample > Web.config:

 

<appSettings>
<add key="powerbi:AccessKey" value="X==" />
<add key="powerbi:Username" value="X" />
<add key="powerbiSmiley Tongueassword" value="X" />
<add key="powerbi:ApiUrl" value="https://api.powerbi.com" />
<add key="powerbi:WorkspaceCollection" value="X" />
<add key="powerbi:WorkspaceId" value="Xcc" />
</appSettings>

 

and to EmbedSample > DashboardController.cs:

 

public class DashboardController : Controller
{
private readonly string workspaceCollection;
private readonly string username;
private readonly string password;
private readonly string workspaceId;
private readonly string accessKey;
private readonly string apiUrl;

public DashboardController()
{
this.workspaceCollection = ConfigurationManager.AppSettings["powerbi:WorkspaceCollection"];
this.username = ConfigurationManager.AppSettings["powerbi:Username"];
this.password = ConfigurationManager.AppSettings["powerbiSmiley Tongueassword"];
this.workspaceId = ConfigurationManager.AppSettings["powerbi:WorkspaceId"];
this.accessKey = ConfigurationManager.AppSettings["powerbi:AccessKey"];
this.apiUrl = ConfigurationManager.AppSettings["powerbi:ApiUrl"];
}

 

Although I have started to get "Debug Assert failed: Warning: Feature switches have not been registered yet so switch values may not be correct". It seems it has something to do with the PowerBI update in March.

More about this issue:

http://community.powerbi.com/t5/Developer/Debug-Assert-failed-Feature-switches-have-not-been-registe...

http://community.powerbi.com/t5/Issues/Error-Feature-switches-have-not-been-registered-yet-so-switch...

Regular Visitor
Posts: 47
Registered: ‎12-15-2015

Re: PowerBI Embedded Sample Connection string

Thanks Nithya, your solution worked in my case!

 

P.S. This stuff is not easy or intuitive... I hope this Power BI embedded maintenance stuff will be enhanced. Why it is not possible to upload power bi report directly through Azure management portal?