2

I am trying to connect to Azure Analysis Services in a small web application. The code that I came up with in Microsoft.AnalysisServices.Tabularis:

Server as_svr = new Server();
String as_conn_str = "Provider=MSOLAP;Data Source=<Server Name>;Integrated Security=SSPI;Persist Security Info=True;";
as_svr.Connect(as_conn_str);

Which uses my Windows Credentials.

Unfortunately I keep getting:

parsing_wstrust_response_failed: Parsing WS-Trust response failed

And more specifically:

    [AdalException: parsing_wstrust_response_failed: Parsing WS-Trust response failed]
   Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext.RunAsyncTask(Task`1 task) +89
   Microsoft.IdentityModel.Clients.ActiveDirectory.AuthenticationContext.AcquireToken(String resource, String clientId, UserCredential userCredential) +29

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor) +0
   System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments) +160
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +101
   Microsoft.AnalysisServices.AadAuthenticator.AcquireToken(Uri dataSourceUri, String dataSource, String identityProvider, String tenantId, String userId, String password, UseAdalCacheType useAdalCache) +970
   Microsoft.AnalysisServices.XmlaClient.OpenHttpConnection(ConnectionInfo connectionInfo, Boolean& isSessionTokenNeeded) +1120
   Microsoft.AnalysisServices.XmlaClient.OpenConnection(ConnectionInfo connectionInfo, Boolean& isSessionTokenNeeded) +405
   Microsoft.AnalysisServices.XmlaClient.Connect(ConnectionInfo connectionInfo, Boolean beginSession) +896
   Microsoft.AnalysisServices.Core.Server.Connect(String connectionString, String sessionId, ObjectExpansion expansionType) +156
   Microsoft.AnalysisServices.Core.Server.Connect(String connectionString) +13
   WebApplication1._Default.Button1_Click(Object sender, EventArgs e) in C:\Visual Studio 2017\Projects\FormAuthAD\WebApplication1\Default.aspx.cs:28
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +9720430
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +204
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +12
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +15
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +35
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1639

I also tried using:

Server as_svr = new Server();
String as_conn_str = "Provider=MSOLAP;Data Source=<Server Name>;User ID=<UserID>;Password=<Password>;Persist Security Info=True; Impersonation Level=Impersonate;";
as_svr.Connect(as_conn_str);

and it yields the same error. It has to be connected to some security settings, but I do not have any experience in this field.

I would be grateful for any help. Thank you.

Cwiokpl
  • 31
  • 4

0 Answers0