The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hello!
When I try to connect to Power BI Dataset from Powershell Script, I get the following error:
Exception calling "Connect" with "1" argument(s): "The connection string is not valid."
At line:1 char:1
+ $serverConn.connect($connectionString)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ConnectionException
Code that I used:
Solved! Go to Solution.
Hi @Alibek ,
Write "Cube" instead of "Catalog", see reference: https://learn.microsoft.com/en-us/analysis-services/instances/connection-string-properties-analysis-...
Make sure all other preconditions for enabling the XMLA API are met, including using a Premium workspace, having XMLA access enabled in the tenant settings and make sure the user has the necessary privileges.
In the Power BI CmdLets there is not relly support for XMLA access except the generic Invoke-PowerBIRestMethod in combination with the executeQueries REST Method. But this can only execute DAX queries and not XMLA calls like refreshing a single partition or creating a calculation group.
BR
Martin
Hi @Alibek ,
Write "Cube" instead of "Catalog", see reference: https://learn.microsoft.com/en-us/analysis-services/instances/connection-string-properties-analysis-...
Make sure all other preconditions for enabling the XMLA API are met, including using a Premium workspace, having XMLA access enabled in the tenant settings and make sure the user has the necessary privileges.
In the Power BI CmdLets there is not relly support for XMLA access except the generic Invoke-PowerBIRestMethod in combination with the executeQueries REST Method. But this can only execute DAX queries and not XMLA calls like refreshing a single partition or creating a calculation group.
BR
Martin
HI @Alibek,
I'd like to suggest you use powershell cmdlet model to handle and operate with power bi service contents.
Power BI Cmdlets reference | Microsoft Learn
Regards,
Xiaoxin Sheng