Power BI paginated report embedding without dataset using service principal

600 views Asked by At

I am having a requirement to embed powerBI paginated report to .Net application using app owns data (Service Principal) approach. But the issue I am facing is that our paginated reports are having datasource as sql stored procedures and not using powerBI dataset.

So, while querying the report details using powerbi client from my .net application, I am getting the datasetId = null. What can be the approach in this case to embed the powerBI report and generate Embed Token & Embed URL from .Net application?

Thanks in advance.

1

There are 1 answers

0
Kotana Sai On

datasetId is not required parameter for Embedding Paginated report.

Publish your paginated report to Power BI Service:

Refer to Publish paginated reports documentation. You need to connect to data source in Settings -> Manage Connections and Gateways.

Embedding Paginated Report:

We can Embed Paginated report only using service principal approach. Refer to Embed a Paginated Report documentation.

When you embed a paginated report, we use configuration object of type IPaginatedReportLoadConfiguration you require report id, access Token and Embed URL.

Getting Embed Parameters:

Since, we follow service principal authentication, we require client secret, client id, report id and workspace id. To get the Embed Parameter follow the below steps.

  1. Generate Access Token to authenticate for Power BI. In MSAL.NET we have AcquireTokenForClient. You can use this and get the access token.
  2. Get the Power BI Report Embed URL and Embed token. You need to send a REST API calls Get Report in Group and Reports GenerateToken In Group to get the details.
  3. Once You have the Embed URL, Access Token and report id, you can embed your paginated Report. Refer to Developer Samples github code.