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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
pangelino
Regular Visitor

Problem embedding report - "This content isn't available"

I've followed the online samples for embedding a report here but in the div where I try to embed the report, I see the message "This content isn't available.  Learn more about Power BI".  In the browser console I see the message "Failed to load resource: the server wabi-us-north-central-redirect.analysis.windows.net/metadata/cluster responded with a status of 403 (Forbidden)".  I've looked at several forum posts and tried many permutations of this including this and this but I keep getting the same error.  Please help!

1 ACCEPTED SOLUTION

I'm going to wrap this up by clarifying my use case and explaining what I did to work around my issue.  First of all, I'm following the "User Owns Data" scenario, or "embedding for your organization" depending on what documentation you're looking at.  The goal is not to use a master account to authenticate, but rather for the end user to authenticate with his/her account and then be presented with the content that they are authorized to view.  I'm building a custom portal to improve upon the user experience provided by powerbi.com, and adding metadata features in the process.

 

The main factor with my issue turned out to be the fact that I was opening a new browser window in order to display the embedded report/dashboard.  I never discovered why that poses a problem, but I have successfully worked around the issue by instead displaying the embedded content in an overlay that takes up the full browser window.  The only properties that I need to pass into the config object to the powerbi.embed function are type, accessToken, and embedUrl.  I don't have to deal with embed tokens at all to make this work.

 

I will also mention that I had a very frustrating experience dealing with Microsoft tech support on this issue, so I'm happy to clarify anything about my solution for people that might stumble upon this post.  I opened a support incident through my MSDN account, and ended up spending many hours over the course of several weeks providing diagnostic information to the Power BI product team.  They really never did anything for me except ask me to jump through lots of hoops, which I did, and it never got me an answer to my question about why I got an error when embedding the content in a new browser window.

View solution in original post

11 REPLIES 11
sdaviesnz
Frequent Visitor

Just letting people know I got this error when my report ID for one request did not match the report ID I had used to acquire the report embed token in another request. Making sure the ID values were the same got rid of the error.

Flem100
Regular Visitor

I got the error because I referenced the power bi java script library twice:

 

This was enough:

 
This one screwed it up:
<script src="scripts/powerbi.js"></script>
eligr
Power BI Team
Power BI Team

Hi @pangelino!

Did you sign up for PowerBI?

Can you log in into PowerBI.com and view your report?

Did you give your application the required permissions?

 

Here are some resourses that can help:

https://docs.microsoft.com/en-us/power-bi/developer/embedded-troubleshoot

 

Eli.

Thanks for your reply, @eligr.  To answer your questions:

  1. Yes, I have a Power BI Pro trial license.
  2. Yes, I can log into powerbi.com and view these reports.
  3. Yes, my appliction has been granted all the available Power BI permissions in the Azure app registration.  It also has a few of the Windows Azure Active Directory permissions.

To provide some additional context, my application is successfully authenticating and getting access to the Power BI API after following the guidance here.  I retrieve the available groups through the API, and then retrieve all the available reports and dashboards within those groups.  My application then displays that information on a web page with the report/dashboard title hyperlinked.  The hyperlink opens a new browser window and attempts to embed the report/dashboard content using the powerbi.embed function and the embed URL retrieved from the API.

 

One thing that is confusing to me is that I keep coming across references to embed tokens, but it's not clear to me under what use cases I have to use an embed token.  The embed samples that I referenced in my original post do not use an embed token.  I looked at the troubleshooting page that you referenced in your reply, but none of that seems very applicable since all of my API calls are succeeding in the C# code.  It's only in the powerbi.embed call that I have a problem.  What can you recommend to debug this further?  Thanks again for your help!

Having recently waded through this labyrinth of configuration, I'll share the parts I got stuck on in hopes that they help you find your solution:

 

- embed tokens are only required if you're using the Premium capacity approach.  Premium capacity is required if your end-users (that is to say, the people viewing your embedded content) do not have Power BI Pro licenses and are not a part of the Power BI Workspace that is hosting your datasets, reports, dashboards, etc.  If your users have their own Pro licenses (sometimes the case if you're sharing internal data with colleagues) and are a member of the source Workspace, you won't need an embed token - JUST your access token.  (It sounds like you're up to speed on access tokens, but let me know if I can expand on those.)

- the bug that plagued me right up until I got embeds working was the TYPE of authentication I was specifying in my request.  I'm taking the Javascript route, but you should be able to figure out what the C# equivalent is: 

                var models = window['powerbi-client'].models;
            
                var config = {
                    type: 'report',
                    tokenType: models.TokenType.Aad,
                    accessToken: accessToken,
                    embedUrl: reportEmbedUrl, 
                    viewMode: models.ViewMode.View,
                    id: reportId,	
                    
                };

Every example I found here and elsewhere on the internet was using "tokenType: models.TokenType.Embed" - which is intended for use with the method I described above.  I was using the Active Directory Authentication Library (adal.js) approach, which checks the user's browser for existing AD sessions (recommended for the end-user-has-Pro-license approach).  When I finally tried dumping "models" to output and saw the parameters model.TokenType accepts, it all came together.

Happy to share my working code if you think it will be of use, but hopefully the above will get you started toward the right solution.  Good luck!

Thank you so much!!!

Thanks for your reply, @discjosh1dp!  To clarify, users of my application typically will NOT have Power BI Pro licenses, but will be members of the workspace(s) in question.  Based on your understanding, does that mean I need to use embed tokens or not?

 

Regarding your code sample, agreed that every sample I had seen previously specified models.TokenType.Embed even when they made no mention of using embed tokens.  Unfortunately, switching to models.TokenType.Aad made no difference for me.  Note that even though I am using C# to retrieve available workspaces and report/dashboard information from the Power BI API, I'm still using JavaScript for the embedding.

Gotcha - if you're using a single "master" account to authenticate your application (i.e. not going the adal.js route described above), then yep, you should be requesting an embed token, and "models.TokenType.Embed" is the correct setting.  

 

An embed token is, as you've surmised, distinct and separate from the authentication token you've already acquired.  In short, the authentication token describes what you have permission to see, while the embed token grants specific permission to load content you can see outside of the Power BI application.

Had to dig a while to find this, but specific requests and call parameters for each type of embed token are documented here:https://msdn.microsoft.com/en-us/library/mt784614.aspx (it was last updated in October 2017, so it should still be accurate).

Full disclosure: my team hasn't tried this approach yet (we'll likely shift to it in the coming months, hence my interest in your question).  Let me know if it works?

Thanks again for sharing what you know, @discjosh1dp.  I'll definitely keep you posted as to how this resolves.  I just opened a suport ticket with Microsoft yesterday because the trial and error approach is wearing me down.

 

My workflow is different from what you describe.  The idea is not to authenticate with a master account.  Rather, each user authenticates to our Azure AD instance as themselves, and they see whatever content they are authorized to see by virtue of the workspaces (AD groups) that they are a member of.  I don't know if that warrants an embed token or not but I'll find out from the authorities.

 

FYI, the link you shared in your last post doesn't work when I click on it but I can reach the page if I copy/paste the URL shown.  I see a trailing space in the href attribute.  Maybe that's the problem? 

 

Good catch on the link above - just fixed it.

 

Thanks for elaborating on your setup. Just a heads up: I've been told by MS representatives as recently as two weeks ago that the model you describe (Power BI free users being able to view content embedded in a third-party app) is being phased out and will stop working entirely sometime in mid-2018. The closest evidence I can find to support this in the MS documentation is here, under "Share content with Power BI FREE users outside PowerBI.com and embed in other SaaS applications": https://docs.microsoft.com/en-us/power-bi/developer/embedded-faq

 

However, since this is an ongoing change, it's possible you may get a different answer (in fact, I received a couple of conflicting reports before we finally found a method that worked for us). If they confirm the above, let me know and I'll share how we addressed the issue.

I'm going to wrap this up by clarifying my use case and explaining what I did to work around my issue.  First of all, I'm following the "User Owns Data" scenario, or "embedding for your organization" depending on what documentation you're looking at.  The goal is not to use a master account to authenticate, but rather for the end user to authenticate with his/her account and then be presented with the content that they are authorized to view.  I'm building a custom portal to improve upon the user experience provided by powerbi.com, and adding metadata features in the process.

 

The main factor with my issue turned out to be the fact that I was opening a new browser window in order to display the embedded report/dashboard.  I never discovered why that poses a problem, but I have successfully worked around the issue by instead displaying the embedded content in an overlay that takes up the full browser window.  The only properties that I need to pass into the config object to the powerbi.embed function are type, accessToken, and embedUrl.  I don't have to deal with embed tokens at all to make this work.

 

I will also mention that I had a very frustrating experience dealing with Microsoft tech support on this issue, so I'm happy to clarify anything about my solution for people that might stumble upon this post.  I opened a support incident through my MSDN account, and ended up spending many hours over the course of several weeks providing diagnostic information to the Power BI product team.  They really never did anything for me except ask me to jump through lots of hoops, which I did, and it never got me an answer to my question about why I got an error when embedding the content in a new browser window.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors