Microsoft says:
"When connecting over TCP to SSAS, the client library will impersonate the Windows user using the specified username and password, and then connect as usual to the server."
"When connecting over HTTP(S) to SSAS, the credentials are provided to the web server based on the authentication mode configured on the web server, for example Basic auth or Windows auth. The web server will perform the appropriate Windows impersonation before connecting to the SSAS server, therefore providing the correct credentials flow to the server."
However, when I do this:
using Tabular = Microsoft.AnalysisServices.Tabular;
using (Tabular.Server server = new Tabular.Server())
{
//connectionString = "Provider=MSOLAP;DataSource=ServerIP;UserID=xx;Password=xx;Persist Security Info=True;Impersonation Level=Impersonate;"
server.Connect(connectionString);
}
It uses the credentials of my user account that's running the code, not the the UserID and Password in the ConnectionString.
How can I get it to connect via "TCP"?
UPDATE: Using the suggestion from @GregGalloway and logic from here: I've implemented an Impersonator class. With it I've updated my code to do the following:
using (Tabular.Server server = new Tabular.Server())
{
using (new Impersonator("UserName", "Domain", "Password"))
{
server.Connect(connectionString);
}
}
Unfortunately, when I profile the call to the SSAS server, I can see that it is still using the same credentials as before and the connection to the server is successful regardless of any credentials being passed to the constructor. Stepping through the code I can see that no exceptions are being thrown at any point.