Power BI Embedded libraries for .NET
Power BI is a cloud-based business analytics service that gives you a single view of your most critical business data.
To learn more about using Power BI with .NET, see Embedding with Power BI.
Client library
Use the client library to connect with Power BI APIs to access and interact with data sets and reports.
Install the NuGet package directly from the Visual Studio Package Manager console.
Visual Studio Package Manager
Install-Package Microsoft.PowerBI.Api
Example
The following example retrieves and displays a list of datasets and reports.
/* Include these'using' directive:
using Microsoft.PowerBI.Api.V2;
using Microsoft.PowerBI.Api.V2.Models;
*/
using (PowerBIClient client = new PowerBIClient(new Uri(apiUrl), tokenCredentials))
{
Console.WriteLine("\r*** DATASETS ***\r");
// List of datasets in a group/app workspace
ODataResponseListDataset datasetList = client.Datasets.GetDatasetsInGroup(groupId);
foreach(Dataset ds in datasetList.Value)
{
Console.WriteLine(ds.Id + " | " + ds.Name);
}
Console.WriteLine("\r*** REPORTS ***\r");
// List of reports in a group/app workspace
ODataResponseListReport reportList = client.Reports.GetReportsInGroup(groupId);
foreach (Report rpt in reportList.Value)
{
Console.WriteLine(rpt.Id + " | " + rpt.Name + " | DatasetID = " + rpt.DatasetId);
}
}
Samples
Explore more sample .NET code you can use in your apps.
Spolupracujte s námi na GitHubu
Zdroj tohoto obsahu najdete na GitHubu, kde můžete také vytvářet a kontrolovat problémy a žádosti o přijetí změn. Další informace najdete v našem průvodci pro přispěvatele.
Azure SDK for .NET
Váš názor
https://aka.ms/ContentUserFeedback.
Připravujeme: V průběhu roku 2024 budeme postupně vyřazovat problémy z GitHub coby mechanismus zpětné vazby pro obsah a nahrazovat ho novým systémem zpětné vazby. Další informace naleznete v tématu:Odeslat a zobrazit názory pro