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
insoldev
Helper I
Helper I

Trouble migrating to new power bi embedded - 403 forbidden

Hi there,

 

I'm having some issues migrating to the new Power BI embedded from workspace collections. 

 

Reports were rendering fine using the javascript API. I was making some fine tuning changes, such as to the filter panel settings, and nav content settings, when suddenly I was unable to render reports. It was like the door was closed!

 

I set the permissions in Azure, granted them etc. I've had no issue generating the report numerous times, though now I cannot.

 

My code below, and the message.

 

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js"></script>
<script src="https://microsoft.github.io/PowerBI-JavaScript/demo/node_modules/powerbi-client/dist/powerbi.js"></script>



<script type="text/javascript">
window.onload = function () {

 // Read embed application token from Model
    var accessToken = "HIDDEN";

    // Read embed URL from Model
    var embedUrl = "https://app.powerbi.com/reportEmbed?reportId=[hidden]&groupId=[hidden]";

    // Read dashboard Id from Model
    var embedReportId = "HIDDEN";

    // Get models. models contains enums that can be used.
    var models = window['powerbi-client'].models;

    var config = {
        height: 800,
        type: 'report',
        tokenType: models.TokenType.Aad,
        accessToken: accessToken,
        embedUrl: embedUrl,
        id: embedReportId ,
        pageView: "oneColumn",
		settings: {
        filterPaneEnabled: false,
	navContentPaneEnabled: false

    }
    };
    // Get a reference to the embedded dashboard HTML element
    var dashboardContainer = $('#reportContainer')[0] ;
    // Embed the dashboard and display it within the div container.

var report = powerbi.embed(dashboardContainer, config);


}

</script>


<div id="reportContainer" style="height:680px"></div>
<p>loaded</p>


wabi-north-europe-redirect.analysis.windows.net/metadata/cluster:1 GET https://wabi-north-europe-redirect.analysis.windows.net/metadata/cluster 403 (Forbidden)
reportEmbed.min.js:1 OPTIONS https://dc.services.visualstudio.com/v2/track 0 ()

1 ACCEPTED SOLUTION

Hi @insoldev,

 

Since you have used it for a while, I would suggest you check out these things below.

1. Which type of the token did you use? The access token or the embed token? As we can see from you code, it should be an access token. 

2. Please also check if you still have access to the App in the Power BI Service. Though this could be a little chance.

3. About how to refresh a token, you can create a new token by using Postman and replace the old one due to you are just testing it.

4. About check how much resource left, please refer to the snapshot below. 

GET https://api.powerbi.com/v1.0/myorg/availableFeatures(featureName='embedTrial')

Trouble_migrating_to_new_power_bi_embedded_403_forbidden

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

8 REPLIES 8
v-jiascu-msft
Employee
Employee

Hi @insoldev,

 

 

Could you please mark the proper answers as solutions?

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Oh wow, I missed your postman example, thank you so much Dale!

v-jiascu-msft
Employee
Employee

Hi @insoldev,

 

You already used it for a while. That's strange.

1. How did you refresh the access token? It seems it isn't included in the code.

2. Did you have a capacity? If your app is in a production environment but isn't assigned to a capacity, it could run out of resources. You can check it out with this API.

>>>Because embed tokens are intended for development testing only, the number of embed tokens a Power BI master account can generate is limited.

3. Were there any changes in the Service App?

 

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I'm having some trouble replying to this. My comments are being marked as spam. If a mod sees this, would you mind checking to see why this is the case?

 

Ah, it is working now. 

 

Basically, I'm not sure how the refresh token works - for testing, I have simply being using postman to generate access tokens, though this is no longer working.

 

In point 2 above, how do I authenticate against the API in postman?

Hi @insoldev,

 

Since you have used it for a while, I would suggest you check out these things below.

1. Which type of the token did you use? The access token or the embed token? As we can see from you code, it should be an access token. 

2. Please also check if you still have access to the App in the Power BI Service. Though this could be a little chance.

3. About how to refresh a token, you can create a new token by using Postman and replace the old one due to you are just testing it.

4. About check how much resource left, please refer to the snapshot below. 

GET https://api.powerbi.com/v1.0/myorg/availableFeatures(featureName='embedTrial')

Trouble_migrating_to_new_power_bi_embedded_403_forbidden

 

Best Regards,

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks Dale - on point 2, what is the best way to test this on Postman? Is my org my tenant ID? How do I authenticate?

insoldev
Helper I
Helper I

Could an awesome community support person or mod help out with this one?

insoldev
Helper I
Helper I

Would it be possible to get some support from a mod or a community support person please? I see that there are quite a few messages requesting support with API error codes.

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.