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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
lherbert501
Post Patron
Post Patron

Embed API Sample error

Hi,

 

I'm trying to create a test embedded location and tried running the sample app from  Guy in a Cube.

 

I'm having a few problems and get this error when I try to run it. Does anybody know what that means?

 

Thanks in advance

 

lherbert501_0-1726073165049.png

 

Could somebody also kindly advise which username and role goes in below?

 

lherbert501_0-1726073944355.png

 

 

 

Code below

 

Thanks

 

guyinacube/Embed-API-Sample: A sample application to use the Power BI APIs for embedding. This makes...

1 ACCEPTED SOLUTION

Hi @lherbert501 ,

I tried to fix it myself, but it seems that this is because some of the content in the predefined configuration file before the code is outdated. If you want to modify it, you may not only need to modify the content in the screenshot, but also go back here to modify it:

vjunyantmsft_0-1726196723680.png

I'm not sure how the original author defined it, but I saw that this document was published 4 years ago:

vjunyantmsft_1-1726196863449.png


So it's very likely that some of the content is outdated. I think the best way is to find the original author and ask him to update it.

Best Regards,
Dino Tao
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

4 REPLIES 4
v-junyant-msft
Community Support
Community Support

Hi @lherbert501 ,

About the first question, have you created a data source connection using one of the gateways to the semantic model of the report you need to embed? And have you change contents here?

vjunyantmsft_0-1726119674845.png

 

And about the second question, based on the screenshot you provided, it looks like you are trying to embed a report with RLS applied. So for the parameter Role, fill in the name of the RLS you created:

vjunyantmsft_1-1726105428848.png

As for the parameter username, it depends on whether you are implementing a static RLS or a dynamic RLS.
If it is a static RLS, then you can give it any string:

vjunyantmsft_2-1726105645709.png

But in the case of a dynamic RLS, the role of username is to pass a parameter value to your previously defined RLS role, so here you need to give username a specific string, i.e., what you want your RLS to be equal to.
You can refer to the following two documents, which explain it in more detail:
https://learn.microsoft.com/en-us/power-bi/developer/embedded/cloud-rls 
https://learn.microsoft.com/en-us/rest/api/power-bi/embed-token/generate-token#example-of-generating... 

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

Hi @v-junyant-msft ,

 

Thankyou for your reply.

 

Could you please help me with the gateway aspect, as I think its the only thing left that's preventing it.

 

I have the gateway connection set up for the report that works fine and refreshes fine as below. Which bit do I change in the code?

 

lherbert501_0-1726136491592.png

 

I was unsure if the code below needed to stay commented out

lherbert501_0-1726138584589.png

 

 

 

Thanks

Hi @lherbert501 ,

I tried to fix it myself, but it seems that this is because some of the content in the predefined configuration file before the code is outdated. If you want to modify it, you may not only need to modify the content in the screenshot, but also go back here to modify it:

vjunyantmsft_0-1726196723680.png

I'm not sure how the original author defined it, but I saw that this document was published 4 years ago:

vjunyantmsft_1-1726196863449.png


So it's very likely that some of the content is outdated. I think the best way is to find the original author and ask him to update it.

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

Hi @v-junyant-msft ,

 

Okay many thanks for looking into this for me 🙂

 

Liam

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.