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

孤街醉人 提交于 2019-11-28 12:59:27

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.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!