Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mangopop
Frequent Visitor

power bi embed 'this content is not available'

I've tried to work through this example and many others but I'm getting no content availabe in the iframe.

 

https://azure.microsoft.com/en-gb/documentation/articles/power-bi-embedded-iframe/

 

I'm also using the angular example from git hub and swapped out the api for my own details. No luck.

 

I can view my reports via the power bi web app without issue.

 

Here's the code I'm using.

 

I've created the JWT and signed it using the JWT website without expiry date (that should work, should it not?)

 

<!DOCTYPE html>
    <html>
    <head>
      <meta charset="utf-8" />
      <meta http-equiv="X-UA-Compatible" content="IE=edge">
      <title>Test page</title>
      <meta name="viewport" content="width=device-width, initial-scale=1">
    </head>
    <body>
      <button id="btnView">View Report !</button>
      <div id="divView">
        <iframe id="ifrTile" width="100%" height="400"></iframe>
      </div>
      <script>
        (function () {
          document.getElementById('btnView').onclick = function() {
            var iframe = document.getElementById('ifrTile');
            iframe.src='https://embedded.powerbi.com/appTokenReportEmbed?reportId=d3d8c45f-17bf-4f4c-bb4f-0affe770daba';
            iframe.onload = function() {
              var msgJson = {
                action: "loadReport",
                accessToken: "eyJhbGciOiJIUzI1NiIsInR5c...blah,blah,blah...TAaQrly9mNc0-PJZMpKQk",
                height: 500,
                width: 722
              };
              var msgTxt = JSON.stringify(msgJson);
              iframe.contentWindow.postMessage(msgTxt, "*");
            };
          };
        }());
      </script>
    </body>
</body>
</html>

Any help would be greatly appreciated.

1 ACCEPTED SOLUTION

(My posts keep getting auto-deleted, maybe I'm not allowed to link to stackoverflow? :/)

 

Ayway, here are the required claims:

 

Required Claims

    ver: 0.2.0
    wcn: {WorkspaceCollectionName}
    wid: {WorkspaceId}
    rid: {ReportId}
    aud: https://analysis.windows.net/powerbi/api
    nbp: Token valid not before in Unix EPOCH time
    exp: Token expiration in Unix EPOCH time

View solution in original post

10 REPLIES 10
ekeijl
Helper I
Helper I

Does the data source of your report use DirectQuery? In that case your might have forgotten this step:

 

https://azure.microsoft.com/en-gb/documentation/articles/power-bi-embedded-iframe/#data-source-conne...

 

You need to tell PowerBI Embedded how to connect to your data source (i.e. credentials), this is not stored in the PBIX file.

Thanks for the reply. This was created with the import option, so I didn't add the connection details. I would be helpful if there were some more informative error messages, as it is I'm a bit stuck.

I am getting this error message GET https://wabi-west-europe-redirect.analysis.windows.net/metadata/cluster 403 (Forbidden) Perhaps it's the created of the JWT that is causing me trouble.

Here's an exampleof the JWT

 

`{
"wid": "c13d0a99-****-****-9d76-2a644847ddde",
"rid": "d3d8c45f-****-****-bb4f-0affe770daba",
"iss": "PowerBISDK",
"ver": "0.2.0",
"aud": "https://analysis.windows.net/powerbi/api",
"wcn": "myWCN",
"type":"embed"
}`

 

That's all I should need to create the access token right?

(My posts keep getting auto-deleted, maybe I'm not allowed to link to stackoverflow? :/)

 

Ayway, here are the required claims:

 

Required Claims

    ver: 0.2.0
    wcn: {WorkspaceCollectionName}
    wid: {WorkspaceId}
    rid: {ReportId}
    aud: https://analysis.windows.net/powerbi/api
    nbp: Token valid not before in Unix EPOCH time
    exp: Token expiration in Unix EPOCH time

It was working for me till today but it stopped working all of a sudden for some of my clients -- can you please share what you think what might have gone wrong

It was working for me till today but it stopped working all of a sudden for some of my clients -- can you please share what you think what might have gone wrong

You are a legend, the docs say optional but they aren't!

 

(It's nbf not nbp!)

 

 

Thank you very much!

 

See here for the required claims: https://www.npmjs.com/package/powerbi-api

 

I recommend you use one of the Power BI SDKs to generate the JWT though.

I recommend that you use one of the SDKs that Microsoft provides to generate the JWT.

 

Example of JWT claims can be found here, documentation on this is hard to find though: https://www.npmjs.com/package/powerbi-api

 

I think you need to include the "nbp" (current timestamp?) and "exp" (expiration timestamp) claims as well.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Kudoed Authors