Forum Discussion

segan's avatar
segan
New Member
3 years ago
Solved

Connecting to Local PowerBI Report Server using Microsoft.PowerBI.Api

Hello,

 

I am trying to programmatically access PowerBI Server (installed in my local machine) using .NET 4.7.

I have included Microsoft.PowerBI.Api nuget package.

My PowerBI server is configured to use Windows Authentication.

 

I am not sure what to pass as credential? I tried passing BasicAuthenticationCredentials as well as TokenCredentials object. But I get Unauthorized error.

 

using (var client = new PowerBIClient(new Uri("localhost:8080/ReportServer"), credentials))
{

var report = client.Reports.GetReports();

}

 

Could someone please help?

 

Thanks,

Segan