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

could'nt load the data for this visual - power bi embedded for customers

Hello, 

 

as a company we use power bi embedded for customers. (so those customers do not have a power bi license but we use a token) 

in the report we use live connection to SSAS model. 

 

frequently, working visuals suddenly break after a random time with the following error message. 

 

Couldn't load the data for this visual

Couldn't retrieve the data for this visual. please try again later. 

Http status code 403

 

when you hit F5 (refresh) the report works fine again. 

 

anybody knows how we can fix this?

1 ACCEPTED SOLUTION
v-rzhou-msft
Community Support
Community Support

Hi @Karola 

Here you are using app owns data to embed your report to your customer. You customers don't need to have access to Power BI. They will access your embedded report in portal by embedded token you assigned to them.

Each token has its lifetime, so I think your issue should be caused by embedded token expiration.

This is the workloads that how your customer gets embedded token.

For reference: Embed for your customers

1.png

Based on my research, we can try to use the token lifetime policy and Assign policy to a service principal to configure the expiretime up to 24 hours, please refer to this document and thread: 

Configurable token lifetimes in the Microsoft identity platform (preview)

Access token setting expiration times


You can also keep the default expire time and generate a new token before expire to update. when generate an embedded token, it will return the expire time, then you can generate a new token before the expire time, please refer to the example code with javascript

https://github.com/microsoft/PowerBI-JavaScript/wiki/Update-Embed-Token

https://github.com/microsoft/PowerBI-JavaScript/wiki/Refresh-token-using-JavaScript-SDK-example

we did not find sample code by RESTful, but the logic should be similar.

 

Update:

 

following policy make the expire time up to 2 hours (token refreshed when 04:55 UTC+0)

 

$policy = New-AzureADPolicy -Definition @('{"TokenLifetimePolicy":{"Version":1,"AccessTokenLifetime":"02:00:00","MaxAgeSessionSingleFactor":"02:00:00"}}') -DisplayName "ApiDefaultPolicyScenario" -IsOrganizationDefault $false -Type "TokenLifetimePolicy"

 

Best Regards,
Rico Zhou

 

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

3 REPLIES 3
v-rzhou-msft
Community Support
Community Support

Hi @Karola 

Here you are using app owns data to embed your report to your customer. You customers don't need to have access to Power BI. They will access your embedded report in portal by embedded token you assigned to them.

Each token has its lifetime, so I think your issue should be caused by embedded token expiration.

This is the workloads that how your customer gets embedded token.

For reference: Embed for your customers

1.png

Based on my research, we can try to use the token lifetime policy and Assign policy to a service principal to configure the expiretime up to 24 hours, please refer to this document and thread: 

Configurable token lifetimes in the Microsoft identity platform (preview)

Access token setting expiration times


You can also keep the default expire time and generate a new token before expire to update. when generate an embedded token, it will return the expire time, then you can generate a new token before the expire time, please refer to the example code with javascript

https://github.com/microsoft/PowerBI-JavaScript/wiki/Update-Embed-Token

https://github.com/microsoft/PowerBI-JavaScript/wiki/Refresh-token-using-JavaScript-SDK-example

we did not find sample code by RESTful, but the logic should be similar.

 

Update:

 

following policy make the expire time up to 2 hours (token refreshed when 04:55 UTC+0)

 

$policy = New-AzureADPolicy -Definition @('{"TokenLifetimePolicy":{"Version":1,"AccessTokenLifetime":"02:00:00","MaxAgeSessionSingleFactor":"02:00:00"}}') -DisplayName "ApiDefaultPolicyScenario" -IsOrganizationDefault $false -Type "TokenLifetimePolicy"

 

Best Regards,
Rico Zhou

 

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

@v-rzhou-msft thank you, just figured out that the token expiration was causing the issue. it looked very random in the beginning but we can now reproduce it exactly. We are deciding if we want to expand expiration or renew. 

thank you for your answer and the links. 

lbendlin
Super User
Super User

how frequently do you refresh your cube?

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.