Please find the PowerShell script below which i wrote to connect to Azure Analysis services to fetch server properties.
[System.Reflection.Assembly]::LoadFile("C:\Users\xxxx\Desktop\AASproperties\microsoft.analysisservices.tabular.13.0.2150.3\lib\Microsoft.AnalysisServices.Core.DLL")
[System.Reflection.Assembly]::LoadFile("C:\Users\xxxx\Desktop\AASproperties\microsoft.analysisservices.tabular.13.0.2150.3\lib\Microsoft.AnalysisServices.Tabular.DLL")
[System.Reflection.Assembly]::LoadFile("C:\Users\xxxx\Desktop\AASproperties\microsoft.analysisservices.tabular.13.0.2150.3\lib\Microsoft.AnalysisServices.Tabular.Json.DLL")
$server = New-Object Microsoft.AnalysisServices.Tabular.Server
$connectionString = "Datasource=asazure://westeurope.asazure.windows.net/<serverName>:rw;initial catalog=<DB Name>;User ID=app:<SP id>@<tenant id>; Password = <secret>"
$server.Connect($connectionString)
Getting this error: "A connection cannot be made. Ensure that the server is running."
Points to note:
Server is running not paused.
Able to create ADOMD connection and can fetch data using DAX/MDX expression.
But cannot create AMO connection, failing with the above error.
Above script works fine with SQL Server Analysis services. (on-prem)
Also tried with old DLL i.e. "Microsoft.AnalysisServices.DLL" but getting the same above error.
Any help would be appreciated!
Thanks,
Aakash