gbrueckl.PowerBI.API 1.1.1

There is a newer version of this package available.
See the version list below for details.
dotnet add package gbrueckl.PowerBI.API --version 1.1.1
NuGet\Install-Package gbrueckl.PowerBI.API -Version 1.1.1
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="gbrueckl.PowerBI.API" Version="1.1.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add gbrueckl.PowerBI.API --version 1.1.1
#r "nuget: gbrueckl.PowerBI.API, 1.1.1"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install gbrueckl.PowerBI.API as a Cake Addin
#addin nuget:?package=gbrueckl.PowerBI.API&version=1.1.1

// Install gbrueckl.PowerBI.API as a Cake Tool
#tool nuget:?package=gbrueckl.PowerBI.API&version=1.1.1

PowerBI.API.Client

A C# wrapper for the Power BI REST API which allows you to easily integrate the Power BI API into your C# application. All objects from PowerBI are represented as native C# objects including all properties, functions/methods, etc. The Power BI REST API is very well documented here: https://docs.microsoft.com/en-us/rest/api/power-bi/ The wrapper includes most of the functionality that available via the REST API but due to the high frequency of updates this wrapper may be a bit slower to integrate the latest features.

Supported features

  • List Dashboards, Reports, Datasets, Groups
  • Import PBIX files
  • Refresh datases
  • Update parameters
  • Rebind/Clone reports
  • Authenticate using username/password for CI/CD scenarios
  • Authenticate using a prompt for interactive use cases

If you need a feature that is not listed above please file an issue here in this repository!

Basic Sample

This is a sample that connects to Power BI by asking the user for credentials, gets a dataset by its name and triggers a refresh

static void Main(string[] args)
{
    string ApplicationID = ConfigurationManager.AppSettings["PBI_ApplicationID"];

    PBIAPIClient pbic = new PBIAPIClient(ApplicationID);
    // PBIAPIClient pbic = new PBIAPIClient(ApplicationID, "myUser@myDomain.com", "Pass@word01!"); // to avoid prompt

    PBIDataset dataset = pbic.GetDatasetByName("myDataset");

    dataset.Refresh();
}

Setup

The setup is quite easy, you just need to download the pre-built DLL from this repository (/PowerBIClient/Download/gbrueckl.PowerBI.API.dll) and add it to your C# project. It was built using .Net framework 4.5! There are also some NuGet packages that are required:

  • Microsoft.PowerBI.Api
  • Microsoft.IdentityModel.Clients.ActiveDirectory

You can either install them manually or via the NuGet Package Manager Console using the following commands:

  • Install-Package Microsoft.PowerBI.Api
  • Install-Package Microsoft.IdentityModel.Clients.ActiveDirectory
Product Compatible and additional computed target framework versions.
.NET Framework net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.3 845 10/14/2020
1.1.2 466 10/14/2020
1.1.1 751 10/28/2019
1.1.0 1,071 11/14/2018
1.0.0 769 11/14/2018

Fixed documentation