cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
vospitannikov
Helper I
Helper I

Embed group report problem

I'm trying to integrate PowerBI report (located in group) into my page using iframe

I've registered AD application

I can query list of reports from the server side

But when I'm trying to use received "embedUrl" value using the same token I'm getting following error message:

"This content is not available.
Learn more about Power BI."

 

At the same time, if I open list of network requests in chrome DevTools, I can see the one request to some page ending in "modelsAndExploration" which return 401 error: Unauthorized

 

If I'm trying to open URL received in webUrl, I can successfully see report in PowerBI interface

 

Any suggestions/ideas?

28 REPLIES 28
vospitannikov
Helper I
Helper I

@BjoernLueers@supermulder@smolina74@Eric_Zhang

 

I believe that this is PowerBI server side error
I've reported issue with detailed steps to reproduce:
https://ideas.powerbi.com/forums/360879-issues/suggestions/16694833-error-group-reports-embedding-wo...
I would really appreciate if you can vote for it
Thank you in advance

I've had the same problem... "This content is not available. Learn more about Power BI" message was showing everytime I tried to open embedded Power BI report in my application. Report was loaded only after I signed to Power BI account and refreshed the page with report in my application.

 

However, everything is working fine after I applied the newest update (November) and published the report. 

 

Thanks, Power BI team! 🙂

supermulder
Frequent Visitor

Thank you. I finally found a solution.

 

I´m not using the powerbi-javascript-library anymore, regarding of the issue that it is not possible to set the groupid of a report at the moment.

 

Instead i use the following javascript-code (based on the provided example).

 

<script>

function loadReportIntoIframe(reportId,groupId,iframeId){
    var iframe = document.getElementById(iframeId);
    var iframeUrl = 'https://app.powerbi.com/reportEmbed?reportId='+reportId;
    if (groupId){
        iframeUrl = iframeUrl + '&groupId=' + groupId;
    }
    iframe.src=iframeUrl;
    iframe.onload = postActionLoadReport;
}

// Post the access token to the IFrame
function postActionLoadReport() {
    // Construct the push message structure
    // this structure also supports setting the reportId, groupId, height, and width.
    // when using a report in a group, you must provide the groupId on the iFrame SRC
    var m = {
        action: "loadReport",
        accessToken: 'YOUR_AAD_ACCESSKEY'
    };
    message = JSON.stringify(m);

    // push the message.
    iframe = document.getElementById('iFrameEmbedReport');
    iframe.contentWindow.postMessage(message, "*");;
}
</script>

Sample:

 

Loading a report from your worksspace:

 

<a href="javascript&colon;loadReportIntoIframe('REPORT_ID','','IFRAME_ID')" >REPORT NAME</a>

Loading a report from group:

<a href="javascript&colon;loadReportIntoIframe('REPORT_ID','GROUP_ID','IFRAME_ID')" >REPORT_NAME</a>

Next i will try to do the same with powerbi dashboards ...

We have exactly the same problem. Embedding of personal reports still works perfectly (except in Chrome) but since recently group reports are not working anymore. We have been using the approach to add a groupID parameter to the report Url but we also tried to set group and report ID via post message with the same negative result.

supermulder
Frequent Visitor

I have exactly the same issue.

 

Embedding of my own reports works fine.

 

I have created 4 groups in power bi - only one report in one group can be embedded without a Problem, all reports that are within the other 3 groups can not be embedded (401 Unauthorized) - the group permissions are all the same.

 

Another problem:

 

I have written a small javascript function to switch dynamicly between reports. At this moment i try to load a report that does not work (see above) some error-handling goes wrong and the function does not longer work, i´m not able to embed the working report anymore  - i think there is some error handling missing in your underlying powerbi.js framework. 

 

function switchReport(id){
var embedConfiguration = {
type: 'report',
id: id,
accessToken: '{{AccessToken}}',
embedUrl: 'https://app.powerbi.com/reportEmbed'
};
var $reportContainer = $('#reportContainer');
var report = powerbi.embed($reportContainer.get(0), embedConfiguration);

}


 

Some additional infos:

 

- I can embed all reports that are attached to my workspace Smiley Happy

 

- I can only embed reports from other workspaces if i attached them to a group dashboard that is shared with my user 

 

It seems that the group-permissions that i´ve configured in the group-configuration are not considered in the embedding process 😞 So i´m only able to embed such reports in which i get a "permission" through the process of dashboard-sharing ...

 

Is this a known issue at the moment ? I would appreciate any help! Thank you!

 

Eric_Zhang
Microsoft
Microsoft


@vospitannikov wrote:

I'm trying to integrate PowerBI report (located in group) into my page using iframe

I've registered AD application

I can query list of reports from the server side

But when I'm trying to use received "embedUrl" value using the same token I'm getting following error message:

"This content is not available.
Learn more about Power BI."

 

At the same time, if I open list of network requests in chrome DevTools, I can see the one request to some page ending in "modelsAndExploration" which return 401 error: Unauthorized

 

If I'm trying to open URL received in webUrl, I can successfully see report in PowerBI interface

 


@vospitannikov

Thanks for the clarification. I can embed the reports from groups well.

 

Regarding the bold part, do you mean that in web Url, you can embed the reports from groups without problem? If yes, what do you mean "in webUrl"?

Hello @Eric_Zhang

 

Thank you for your response

 

By "webUrl" I mean data received during requesting reports from API (please pay attention to bolded text below)

http://docs.powerbi.apiary.io/#reference/report-preview/reports-collection/list-all-reports

 

{
  "@odata.context": "https://api.powerbi.com/beta/myorg/$metadata#reports",
  "value": [
    {
      "id": "84dbd390--5eb9fe91cdba",
      "name": "AdventureWorks",
      "webUrl": "https:// app.powerbi.com/reports/84dbd390---5eb9fe91cdba",
      "embedUrl": "https://app.powerbi.com/embedReport?reportId=84dbd390--5eb9fe91cdba"
    }
  ]
}

  

I still facing the same problem during embedding group reports

and located in my personal workspace reports can be embed without any problems

 

@Eric_Zhang, have you configured any special permissions for datasets/reports in order to let them be shared via embedding?

@vospitannikov

Would you mind uploading the project in VS? By the way, ensure all the options are checked when registering an app for PBI.

Capture.PNG

 

 

@Eric_Zhan, all PowerBI application settings permissions was checked

Hello @Eric_Zhang

 

I've uploaded project where I can reproduce this error to GitHub

https://github.com/vospitannikov/PowerBIGroupReportIntegrationError

 

Please pay attention to "TODO" comments in order to set all needed data

Also, you need to create PowerBI application before running this project

 

You need access to some PowerBI group with report

1. access to some PowerBI group with report (in order to reproduce this error)

2. some not group report (in order to see that it works fine for general reports, not group one)

 

Please let me know if you can reproduce this error

@Eric_Zhang Do you have any idea / hint regarding my posts above ?

 

Here are some additional information of what happened in the background:

 

Chrome Console:

 

Screenshot at Sep. 13 06-52-27.png

 

 

Call Response:

 

 

{"error":{"code":"UnknownError","pbi.error":{"code":"UnknownError","parameters":{},"details":[]}}}

 Behaviour:

 

  1. Embedding of reports that are directly attachted to my workspace works without any problem
  2. Embedding of group-reports that are shared additionaly through a dashboard-sharing works even too
  3. Group-reports with the correct permission for my user (i´m able to view them in powerbi online) cannot be embedded, instead of the report i get the message "This content is not available" and the error described above.

Access-Token Generation:

 

$session = $this->get("session");
        $provider = new \TheNetworg\OAuth2\Client\Provider\Azure([
            'clientId'          => $this->clientId,
            'clientSecret'      => $this->clientSecret,
            'redirectUri'       => $this->redirectUri,
            ''
        ]);
        if (!isset($_GET['code'])) {
            // If we don't have an authorization code then get one
            $authUrl = $provider->getAuthorizationUrl();
            $session->set("oauth2state",$provider->getState());
            header('Location: '.$authUrl);
            exit;

        } else {
            $token = $provider->getAccessToken('authorization_code', [
                'code' => $_GET['code']
            ]);
        }

Token - Values Dump:

 

array:7 [▼
  "token_type" => "Bearer"
  "scope" => "Dashboard.Read.All Dataset.ReadWrite.All Group.Read Report.Read.All"
  "ext_expires_in" => "0"
  "expires_on" => "1473745814"
  "not_before" => "1473741914"
  "resource" => "https://analysis.windows.net/powerbi/api"
  "id_token" => "...."
]

Question:

 

Is it possible that i have to do something additional to get an accesstoken that provides access to group workspaces instead of having only access to reports / dashboards that are directly attached to my workspace ?

@supermulder, I've got same error - 401 during accessing .../modelsAndExploration URL

and the same error text: 

{"error":{"code":"UnknownError","pbi.error":{"code":"UnknownError","parameters":{},"details":[]}}}

@vospitannikov Have you found a solution in the meantime ?

@supermulder, no, embedding group reports doesn't work 😞

@Eric_Zhang Any ideas left ? Maybe it´s neccesarry to provide the workspace-id for a specific power bi group to read the reports from this group ? 

@vospitannikov

 

I follow the tutorial and it works loading report from a group and have now further idea on what exactly happens in your case. Maybe you will ask for support from Microsoft.

Hell @Eric_Zhang

Thank you for testing group report integration

 

Can you confirm, that this integration works correctly even if you didn't open PowerBI portal before testing?

So, steps to reproduce should be like this:

  1. close all browser windows
  2. open page with embed report
  3. the report works as expected

It is important to close all browser windows before testing because, as @hesmono said, if you login to PowerBI portal, then integration works as expected. It looks like some additional cookies such as ".AspNet.Cookies", "ASP.NET_SessionId" from app.powerbi.com domain are added during login to PowerBI portal

 

Thank you in advance

@Eric_Zhang 

 

you said you made it work, did you try accessing reports from new groups? Since, we're having the same problem only with new groups (for groups that were created like 3 months ago we don't have any problem at all) and we're also following the tutorial you mentioned.

 

regards

Helpful resources

Announcements
June 2022 update 768X460.jpg

Check it out!

Click here to read more about the June 2022 updates!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors