Forum Discussion
PowerBI Embedded Sample Connection string
I am also getting the same error message: "Bad Request" (see stack trace below) and I'm not really sure why.
After adding the new dataset (pbix file) I then execute #7, enter Username and Password (I'm assuming this is the same username and password used to connect to, in my case, the Azure SQL Database) and then enter the connection string with the server and database. I entered the connection string in two different ways to no avail:
Data Source=xxxx.database.windows.net;Initial Catalog=dbName;User ID=xxx;Password=xxx;
and also:
Data Source=xxxx.database.windows.net;Initial Catalog=dbName;
I also deleted the published dataset and imported it again, but nothing.
Is there an updated version of the ProvisionSample code???
Ooops, something broke: Microsoft.Rest.HttpOperationException: Operation returned an invalid status code 'BadRequest'
at Microsoft.PowerBI.Api.V1.Datasets.<SetAllConnectionsWithHttpMessagesAsync>d__15.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.PowerBI.Api.V1.DatasetsExtensions.<SetAllConnectionsAsync>d__21.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at ProvisionSample.Program.<UpdateConnection>d__27.MoveNext() in C:\Users\EduardoGamez_vheyphg\Documents\Visual Studio 2015\Projects\PowerBI Embedded\ProvisionSample\Program.cs:line 592
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
at ProvisionSample.Program.<Run>d__17.MoveNext() in C:\Users\EduardoGamez_vheyphg\Documents\Visual Studio 2015\Projects\PowerBI Embedded\ProvisionSample\Program.cs:line 235
Power BI team - if you can please update the sample code with this important fact?
Thanks!