Forum Discussion

mangopop's avatar
mangopop
Frequent Visitor
10 years ago
Solved

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.

  • ekeijl's avatar
    ekeijl
    9 years ago

    (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

10 Replies