Skip to content
Go to file
This branch is 34 commits ahead, 186 commits behind microsoft:master.

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Power BI for .NET Standard NuGet Visual Studio Team services

For the official SDK please go to their repository.

Install from Nuget

Install-Package PowerBI.Api

For more information regarding onboarding to Power BI Embedded see our Embedding documentation.

Usage: Calling the GetReports API in a netcoreapp2

In the official documentation you will find references to UserPasswordCredential. This class is not available in netcoreapp2. To get a token from Azure AD you will need to call the API directly as illustrated below.

private async Task<TokenCredentials> GetAccessToken()
    using (HttpClient client = new HttpClient())
        string tenantId = "";
        var tokenEndpoint = "";
        var accept = "application/json";
        var userName = "";
        var password = "";
        var clientId = "";

        client.DefaultRequestHeaders.Add("Accept", accept);
        string postBody = null;

        postBody = $@"

        var tokenResult = await client.PostAsync(tokenEndpoint, new StringContent(postBody, Encoding.UTF8, "application/x-www-form-urlencoded"));
        var tokenData = await tokenResult.Content.ReadAsStringAsync();

        JObject parsedTokenData = JObject.Parse(tokenData);

        var token = parsedTokenData["access_token"].Value<string>();
        return new TokenCredentials(token, "Bearer");

public async Task<IActionResult> Index()

    var tokenCredentials = await GetAccessToken();

    // Create a Power BI Client object (it will be used to call Power BI APIs)
    using (var powerBiclient = new PowerBIClient(new Uri(""), tokenCredentials))

        // Get a list of all groupts
        var groups = powerBiclient.Groups.GetGroups();

        // Do anything you want with the list of groups.
    return View();

Usage: Conflict with Microsoft.Rest.ClientRuntime

Should you receive a conflict with Microsoft.Rest.ClientRuntime after adding the package, you just need to add a reference the latest version directly in your application by using: dotnet add package Microsoft.Rest.ClientRuntime


Welcome to the unofficial port of the .NET SDK for Power BI to .NET Standard 2.0. Here you will find resources on how to use the SDK in .NET Core or with other .NET Standard projects.




No releases published


No packages published


You can’t perform that action at this time.