I'm successfully connecting to a Power BI Service instance to run commands from C# code using AdomdConnection and have problems connecting to the same Power BI Service instance with Microsoft.AnalysisServices.Tabular Server.Connect()
Server.Connect() from Microsoft.AnalysisServices.Tabular fails with:
Session ID cannot be found. Either the session does not exist or it has already expired
What is the difference in how the two clients (ADOMD vs. TOM) handle the access token and the session? Does TOM require additional permissions in Azure? Why would this fail?
AdomdConnection that works:
string xmlaEndpoint = "powerbi://api.powerbi.com/v1.0/myorg/myworkspace";
string connectionString = $"Data Source={xmlaEndpoint};Catalog={datasetName}";
AdomdConnection connection = new AdomdConnection(connectionString);
DateTimeOffset expiration = DateTimeOffset.Parse(req.accessTokenExpiration);
connection.AccessToken = new Microsoft.AnalysisServices.AccessToken(req.accessToken, expiration);
connection.Open();
Microsoft.AnalysisServices.Tabular that fails:
string xmlaEndpoint = "powerbi://api.powerbi.com/v1.0/myorg/myworkspace";
var server = new Microsoft.AnalysisServices.Tabular.Server();
server.Connect(xmlaEndpoint, req.accessToken);
I'm generating the token using a Service Principal, not a user. I have Power BI Service PPU.
