question

RichardOakham-8821 avatar image
0 Votes"
RichardOakham-8821 asked AndreasB-6618 commented

Can adomd .net core connect to an SSAS endpoint from Linux?

Hi, I've a C# .Net Core 3.1 application, using the latest adomd .net core client, that successfully connects to an SSAS server and retrieves data when run on a Windows (Win10) platform. I've compiled it as portable, specific with libraries, and specific single file, and no option is able to connect from Linux, indicating in an error message that the connection is only available from Windows. The Linux box has the 3.1 and 5.0 asp.net runtimes, and the .net core runtimes the same. I've looked for documentation on this, no luck so far, to see if it is possible or not. The connection string is providing a username and password, as this will generally not be the user that the machine is running as. Does anyone have a definitive answer as to if we can connect to SSAS and run MDX queries from a Linux machine currently? Many thanks Richard

sql-server-analysis-services
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

LukasYu-msft avatar image
0 Votes"
LukasYu-msft answered LukasYu-msft edited

Hi,
Could you share the error screenshot ? What is your authentication method in this connection ?
There is some article about connecting to SSAS using Python in Linux in this.





If the answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
What can I do if my transaction log is full?--- Hot issues November
How to convert Profiler trace into a SQL Server table -- Hot issues November


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RichardOakham-8821 avatar image
0 Votes"
RichardOakham-8821 answered RichardOakham-8821 published

Hi

Thanks for the response.

I'd actually trialled the cdata connector method, but wasn't able to get it to connect, I'm uncertain as to if the SQL datasource permits the connect method they were trying. Even ODBC from Windows didn't want to connect, so there is a good chance I'd missed something I guess.

That said, the error I get when trying to connect from Linux is:

Building connection to SSAS server ...

Trying {correct server name}\DSS_PRD

Unhandled exception. System.NotSupportedException: This feature is supported for a .NET Core client only on Windows systems.

at Microsoft.AnalysisServices.AdomdClient.XmlaClient.OpenConnectionAndCheckIfSessionTokenNeeded(ConnectionInfo connectionInfo)

at Microsoft.AnalysisServices.AdomdClient.XmlaClient.<>c_DisplayClass92_0.<OpenConnection>b_0()

at Microsoft.AnalysisServices.Platform.Security.TransparentUserContext.ExecuteInUserContextImpl[TResult](Func`1 action)

at Microsoft.AnalysisServices.Platform.Security.UserContext.ExecuteInUserContext[TResult](Func`1 action)

at Microsoft.AnalysisServices.AdomdClient.XmlaClient.OpenConnection(ConnectionInfo connectionInfo, Boolean& isSessionTokenNeeded)

at Microsoft.AnalysisServices.AdomdClient.XmlaClient.Connect(ConnectionInfo connectionInfo, Boolean beginSession)

at Microsoft.AnalysisServices.AdomdClient.AdomdConnection.XmlaClientProvider.Connect()

at Microsoft.AnalysisServices.AdomdClient.AdomdConnection.XmlaClientProvider.Microsoft.AnalysisServices.AdomdClient.AdomdConnection.IXmlaClientProviderEx.ConnectXmla()

at Microsoft.AnalysisServices.AdomdClient.AdomdConnection.ConnectToXMLA(Boolean createSession, Boolean isHTTP)

at Microsoft.AnalysisServices.AdomdClient.AdomdConnection.Open()

at ssaslink.Program.DoPeriod(String period) in C:\Users\oakhamr\source\ssaslink\ssaslink\Program.cs:line 47

at ssaslink.Program.Main(String[] args) in C:\Users\oakhamr\source\ssaslink\ssaslink\Program.cs:line 14

Aborted

I understand the error message says that the method I'm trying is only on Windows (although couldn't find what specifically is not available in Linux to connect), but some online links appear to have Linux connecting and I don't see how.

The connection string (working from Win10) is
$"Data Sources={server};Initial Catalog={catalog};UID={Username};PWD={password}"

I have a feeling this just isn't possible yet :( or I'm missing something obvious!

Many thanks

Richard

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

dgosbell avatar image
0 Votes"
dgosbell answered rajaobj commented

although couldn't find what specifically is not available in Linux to connect

So when you are connecting to an on-prem SSAS server using <servername>\<instancename> it requires Windows authentication - which is not available on Linux. If you are connecting to Azure AS or Power BI Premium XMLA endpoints it uses OAuth2 which is supported on linux.

You could maybe try configuring HTTP Access on your server and connecting via that. I have not tried this via linux but it may work.


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @dgosbell ,
As specified below, we are able to connect to AAS through .NETCore inside Linux system , right now we are trying to achieve the same to one of our SSAS Server and we are getting error. we dont want to use msmdpump and want to access through .NET Core

71606-image.png


0 Votes 0 ·
image.png (492.4 KiB)
LukasYu-msft avatar image
0 Votes"
LukasYu-msft answered

Have you made any progress with HTTP access ? Any updates on this ?

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

SibiNarayanaswamy-2018 avatar image
0 Votes"
SibiNarayanaswamy-2018 answered dgosbell commented

Hi,

Is it resolved? Curious to know if there is a solution available for this...

I am also trying a similar scenario but not successful in getting this (adomd .net core connect to an SSAS endpoint from Linux) to work.

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

The previous answer I posted suggesting configuring HTTP Access should work as long as you enable basic auth. The default authentication when connecting to directly SSAS is to use Windows authentication and I do not believe this works with linux.


0 Votes 0 ·

Thanks for the prompt response. "Configuring HTTP Access" needs the msmdpump to be configured in IIS in Windows. I need a solution - client using adomd libraries in linux to connect to Azure Analytic Service (and Model exposed by latest version of PowerBI which is similiar to AAS) without any intermediate layer/service in Windows.

Created a sample client using adomd.net libraries. The application works in Windows environment. However, the identical version in Linux fails.

0 Votes 0 ·
dgosbell avatar image dgosbell SibiNarayanaswamy-2018 ·

So the acronym SSAS is usually used to mean the on-prem install of Analysis Services which is what I assumed your were talking about.

Azure AS uses OAuth2 for authentication so it's not windows specific and should work fine with linux and the core version of adomd.net. I have not tried this myself on linux, but it should popup a browser page asking for your AzureAD credentials the same way it does on windows. What error message are you getting?

0 Votes 0 ·
SibiNarayanaswamy-2018 avatar image
0 Votes"
SibiNarayanaswamy-2018 answered SreeDattaReddyKondapoor-7658 commented

Sorry about the confusion. SSAS , I meant the cloud service. Our team wrote a python script to invoke the adomd and what we ended up with the below error message.

 root@d1ncolljob001 ~]# python3 pyaas.py
 Traceback (most recent call last):
  File "pyaas.py", line 8, in <module>
    with Pyadomd(conn) as conn:
  File "/usr/local/lib/python3.8/site-packages/pyadomd/pyadomd.py", line 128, in __init__
    self.conn.ConnectionString = conn_str
 System.EntryPointNotFoundException: GetConsoleWindow assembly:<unknown assembly> type:<unknown type> member:(null)
  at (wrapper managed-to-native) Microsoft.AnalysisServices.AdomdClient.Platform.Windows.Interop.NativeMethods.GetConsoleWindow()
  at Microsoft.AnalysisServices.AdomdClient.Platform.Windows.Utils.WindowsRuntimeHelper.IsProcessWithUserInterface () [0x00018] in <7bc07fcc34d349be86dfb95e964041d1>:0
  at Microsoft.AnalysisServices.AdomdClient.Platform.Configuration.ConfigurationHelper.CheckIfProcessWithUserInterface () [0x00009] in <7bc07fcc34d349be86dfb95e964041d1>:0
  at Microsoft.AnalysisServices.AdomdClient.Platform.Configuration.RuntimeConfiguration..ctor (System.Collections.Generic.IDictionary`2[TKey,TValue] configuration) [0x0000a] in <7bc07fcc34d349be86dfb95e964041d1>:0
  at Microsoft.AnalysisServices.AdomdClient.Platform.Configuration.ConfigurationHelper.EnsureConfigurationIsLoaded () [0x00034] in <7bc07fcc34d349be86dfb95e964041d1>:0
  at Microsoft.AnalysisServices.AdomdClient.Platform.Configuration.ConfigurationHelper.get_Runtime () [0x00000] in <7bc07fcc34d349be86dfb95e964041d1>:0
  at Microsoft.AnalysisServices.AdomdClient.ConnectionInfo.HandleAsAzureconnections () [0x001f8] in <7bc07fcc34d349be86dfb95e964041d1>:0
  at Microsoft.AnalysisServices.AdomdClient.ConnectionInfo.ValidateAndCompleteConnectionConfiguration () [0x000b7] in <7bc07fcc34d349be86dfb95e964041d1>:0
  at Microsoft.AnalysisServices.AdomdClient.ConnectionInfo.SetConnectionString (System.String cs) [0x00485] in <7bc07fcc34d349be86dfb95e964041d1>:0
  at Microsoft.AnalysisServices.AdomdClient.ConnectionInfo..ctor (System.String connectionString) [0x00037] in <7bc07fcc34d349be86dfb95e964041d1>:0


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

We are having similar use case. We have Pyadomd running on Local windows working like charm but when deployed to Ubuntu Container failed with exact same error. Would like to understand how was it resolve at your end :)

0 Votes 0 ·
dgosbell avatar image
0 Votes"
dgosbell answered dgosbell commented

So I think your issue is the pyadomd package. From the source code in the github repo for that package it was last updated before the .net core version of ADOMD.NET was released and is referencing the full framework version of adomd which is windows only. And they have an open issue in their issue list https://github.com/S-C-O-U-T/Pyadomd/issues/3 asking them to add .net core support.


· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

And I just did a quick test on a debian instance using a C# .net core application and it worked fine connecting to Azure AS. I was wrong about the app prompting for credentials, but it gave a clear error that interactive logon was not supported so I added the credentials to the connection string and it worked the same as it did on my windows machine.

0 Votes 0 ·
rajaobj avatar image
0 Votes"
rajaobj answered dgosbell commented

Hi,
we are using RHEL and tried out the code using C# , When we execute the code we are getting an error message
As specified above i have added the credentials in the connecting string itself.


[root@d1~]# mono azure.exe
GetConsoleWindow assembly:<unknown assembly> type:<unknown type> member:(null)




· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@rajaobj - It looks like you are using mono, not .net core. I'm not overly experienced in cross platform .net code, but my understanding is that mono is an open source implementation of the .net framework and the framework version of the adomd library is windows only, while the newer core version is cross platform. This article compares mono and .net core


0 Votes 0 ·
SibiNarayanaswamy-2018 avatar image
0 Votes"
SibiNarayanaswamy-2018 answered AndreasB-6618 commented

@dgosbell - Thanks for your support. We were able to execute using .NET core in a Linux environment.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@SibiNarayanaswamy-2018 : Would you mind sharing your detailed steps to install .Net core in Linux and use python to run a basic mdx/dmv against an OLAP cube?

0 Votes 0 ·
rajaobj avatar image
0 Votes"
rajaobj answered AndreasB-6618 commented

@dgosbell Thanks for your support, finally we were able to achieve the solution using .Net Core.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @rajaobj
What is the solution then? I'm still struggling to find the solution and have the same issue:

with Pyadomd(conn_str) as conn:
File "/home/ubuntu/.local/lib/python3.7/site-packages/pyadomd/pyadomd.py", line 158, in enter
self.open()
File "/home/ubuntu/.local/lib/python3.7/site-packages/pyadomd/pyadomd.py", line 140, in open
self.conn.Open()
System.EntryPointNotFoundException: GetConsoleWindow
at (wrapper managed-to-native) Microsoft.AnalysisServices.AdomdClient.Interop.NativeMethods.GetConsoleWindow()
at Microsoft.AnalysisServices.AdomdClient.Utilities.WindowsRuntimeHelper.IsProcessWithUserInterface () [0x00018] in <a8dc7deda9f6430dbe1fb497406081af>:0

...

0 Votes 0 ·

@rajaobj : Would you mind sharing your detailed steps to install .Net core in Linux and use python to run a basic mdx/dmv against an OLAP cube?

0 Votes 0 ·