Forum Discussion

spoutrain's avatar
spoutrain
Regular Visitor
6 years ago
Solved

Unable to embed a paginated report

Hi community,

 

We face an issue with embedding a Paginated Report in an app-owns-data scenario, using a service principal. Here are the preparation steps we have made:

- Create a service principal

- Added the service principal to the workspace it needs access to

- Create a small PBI Dataset that connects to Azure Synapse

- Create and publish a Paginated Report connected on this PBI Dataset

 

Report can be consumed in PBI Service. Now, we try to embed it. We use Power BI Embedded Playground for now to execute our test. Here is how we proceed step-by-step:

Step 1: Get access token

POST https://login.microsoftonline.com/8d5455c7-b671-44f3-xxxx-xxxxxxxxxxxx/oauth2/token
with following x-www-form-urlencoded parameters:

resource: https://analysis.windows.net/powerbi/api

grant_type: client_credentials
client_id: client id of the service principal
client_secret: client_secret of the service principal

Step 2: Get embed token

POST https://api.powerbi.com/v1.0/myorg/groups/d77d6ae5-82ff-4c93-xxxx-xxxxxxxxxxxx/reports/c14a6770-88a7-xxxx-xxxxxxxxxxxx/GenerateToken
{
"accessLevel": "View",
"identities": [
{
"username": "John Doe",
"reports": ["c14a6770-88a7-4ece-xxxx-xxxxxxxxxxxx"]
}
]
}

Step 3: Get the embed url

GET https://api.powerbi.com/v1.0/myorg/groups/d77d6ae5-82ff-4c93-xxxx-xxxxxxxxxxxx/reports/c14a6770-88a7-4ece-xxxx-xxxxxxxxxxxx

Step 3: Embed the report

Now we try to embed our report using the Embed token acquired at step 2. But, it does not work:

 

Note: Interestingly, this whole process will work if I don't add any data to the Power BI Report Builder. It fails as soon as a connection to a data source is needed, which is obviously 100% of our cases 😉

 

Thanks a lot for your help !

  • Quick update on this in case anyone faces the same issue.

     

    Once the Paginated Report is published in Power BI Service, you must go in the report settings and adjust your credentials there.  Whatever credentials you used in the Power BI Report Builder application, thoses credentials won't be published in the service, so you need to set them up, and everything will work fine afterward.

2 Replies

  • v-deddai1-msft's avatar
    v-deddai1-msft
    Icon for Community Support rankCommunity Support

    Hi spoutrain,

     

    Sorry for can't reproduce your issue .If you have Pro account I suggest you  try to open a support ticket. If you have a Pro account it is free. Go to https://support.powerbi.com. Scroll down and click "CREATE SUPPORT TICKET".

     

    Best Regards,

    Dedmon Dai

  • spoutrain's avatar
    spoutrain
    Regular Visitor

    Quick update on this in case anyone faces the same issue.

     

    Once the Paginated Report is published in Power BI Service, you must go in the report settings and adjust your credentials there.  Whatever credentials you used in the Power BI Report Builder application, thoses credentials won't be published in the service, so you need to set them up, and everything will work fine afterward.