Connection String error while using ADOMD.NET to connect to Azure Analysis

后端 未结 2 743
旧时难觅i
旧时难觅i 2020-12-11 10:43

I am trying to retrieve data from Azure Analysis Services using ADOMD.NET from a deployed model in cloud. The code snippet is as below, but i am getting an error that the Co

相关标签:
2条回答
  • 2020-12-11 10:57

    Turns out that this issue is due to the RTM version of AdomdClient not actually supporting the RTM version of Azure Analysis Services. As a result, the following Nuget Package is required:

    https://github.com/ogaudefroy/Unofficial.Microsoft.AnalysisServices.AdomdClient

    Once you remove / uninstall the version 12 ( the RTM version ) of Microsoft.AnalysisServices.AdomdClient.12.0.2000.8 and install the above AdomdClient everything works just fine. In short, the v12 version doesn't have the code built in to parse asazure:// Data Sources

    Highly annoying with no documentation on Microsoft's site nor support relating to the problem. However this will address your question.

    0 讨论(0)
  • 2020-12-11 11:03

    The first thing you need to do is to ensure you have the latest ADOMD.NET (AdomdClient) installed. Download it from here. After you have installed it, then make sure your C# project has a reference to it at:

    C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.AnalysisServices.AdomdClient\v4.0_13.0.0.0__89845dcd8080cc91\Microsoft.AnalysisServices.AdomdClient.dll

    Next, you need to change your connection string to:

    string connectionString = @"Data Source=asazure://westus.asazure.windows.net/bbacloud;User ID=user@domain.com;Password=pwdHere;Initial Catalog=DatabaseNameHere";
    

    Note a few things. First, it's User ID not UserName. Second, the user needs to be an Azure Active Directory user (an organizational account, not a personal LiveID). Finally, you need to specify the Initial Catalog to ensure that you connect to the correct database in case you ever have multiple databases deployed.

    0 讨论(0)
提交回复
热议问题