gbrueckl.PowerBI.API
1.0.0
See the version list below for details.
dotnet add package gbrueckl.PowerBI.API --version 1.0.0
NuGet\Install-Package gbrueckl.PowerBI.API -Version 1.0.0
<PackageReference Include="gbrueckl.PowerBI.API" Version="1.0.0" />
paket add gbrueckl.PowerBI.API --version 1.0.0
#r "nuget: gbrueckl.PowerBI.API, 1.0.0"
// Install gbrueckl.PowerBI.API as a Cake Addin #addin nuget:?package=gbrueckl.PowerBI.API&version=1.0.0 // Install gbrueckl.PowerBI.API as a Cake Tool #tool nuget:?package=gbrueckl.PowerBI.API&version=1.0.0
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 | Versions 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. |
-
- Microsoft.IdentityModel.Clients.ActiveDirectory (>= 3.19.2)
- Microsoft.PowerBI.Api (>= 2.0.12)
- Microsoft.Rest.ClientRuntime (>= 2.3.6)
- Newtonsoft.Json (>= 11.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial 1.0.0 release