Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Am trying to connect to a Power BI workspace by using the Workspace Connection URL.
Below is the code:
public static void ConnectToPowerBIAsUser()
{
string workspaceConnection = "powerbi://api.powerbi.com/v1.0/myorg/Superstoresales";
string userId = "test@nousinfo.com";
string password = "********";
string connectStringUser = $"DataSource={workspaceConnection};User ID={userId};Password={password};";
server.Connect(connectStringUser);
}
When i execute the code am getting the below error:
Microsoft.AnalysisServices.ConnectionException: 'The connection string is not valid.'
Inner Exception:
FormatException: Input string was not in a correct format.
The key here is using the correct libraries
counter-intuitively do not use the Microsoft.AnalysisServices.Tabular library
you need to use these libraries based on your code base.
For .NET Core we need to install those two libraries:
Microsoft.AnalysisServices.NetCore.retail.amd64
Microsoft.AnalysisServices.AdomdClient.NetCore.retail.amd64
For .NET Framework those two libraries:
Microsoft.AnalysisServices.retail.amd64
Microsoft.AnalysisServices.AdomdClient.retail.amd64
As far as I can tell, the connection string looks fine. Can you confirm that this workspace is associated with a dedicated capacity?
Can you confirm your user ID is for a user with a Power BI Premium per User license.
Did you copy the URL from workspace setting to ensure it matches
I tried with Username, Password and with Access token as well.
But am getting the same error in both cases.
Am having Premium Per User license.
Please find the below screenshot for reference.
OK, one more thing to check. The Capacity administrator has the ability to set the XMLA endpoint to Off, Read Only or Read Write. If it is set to Off, the behavior you are seeing is expected. Are you able to check the XMLA Endpoint setting in Capacity Settings in the Power BI Admin portal as shown in this screenshot? If you don't have Capacity Admin permissions, you will need to find someonbody who does.
HI @TedPattison
I have eneabled XMLA Endpoint for ReadWrite and when i try to execute the above code am again getting the same error.
Could you please provide your inputs?
I have given you all the ideas I have about what the problem might be and how to troubleshoot it. I cannot think of anything else that might be wrong. I think at this point, you should contact Microsoft support who can captire more diagnositc info that might help to troubleshoot this.
Do capacity settings will be available for premium per user account?
When am checking admin portal capacity settings are not available for my premium per user account.
@TedPattison No workspace is not associated with dedicated capaticy.
Premium per user is enabled for the workspace.
Do we require premium capacity to perform data refresh?
The documentation doesn't mention anything explicitly but I wouldn't be surprised if there were API limitations too
User | Count |
---|---|
16 | |
5 | |
2 | |
1 | |
1 |
User | Count |
---|---|
22 | |
3 | |
3 | |
2 | |
2 |