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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
mozakkir1
New Member

Power Bi embed with Java based web application

Hello Everyone,

 

We have a bunch of power bi reports and dashboard that we want to embed to our java based web apllication. 

I registered my web applciation in https://dev.powerbi.com/apps. I got Client Id and Client Secret.

 

I am trying to embed my dashboard by following this example. https://microsoft.github.io/PowerBI-JavaScript/demo/v2-demo/index.html#

 

I am not sure how to get below using Client Id and Client Secret.

1) Embed Token

2) Embed URL

3) Report Id

 

Can some help me with java/javascript code to get the above three fields using Client Id and Client Secret. Once I have these three fields I can embed report in my java application

 

8 REPLIES 8
ashorekumar
Frequent Visitor

 

I was able to embed power BI report on my java application.Please check below url:

https://stackoverflow.com/questions/50156057/steps-to-integrate-powerbi-report-on-java-application

 

@ashorekumar Could you send your first step codes ? (Generating AAD token with Java) 

@ashorekumar After created AAD Token i need to generate Embed Token . Is it possible with this https://community.powerbi.com/t5/Developer/Rest-api-usage-with-Java/m-p/58514#M1841 ? Or have can i generate Embed Token with this sample?

@d_u_a: As per this article: how-many-embed-tokens-can-i-createEmbed tokens with PRO license are intended for development testing, so the number of embed tokens a Power BI master account can generate is limited. You must purchase a capacity for embedding in a production environment. There is no limit to how many embed tokens you can generate when a capacity is purchased.

 

Hence I have not tried it.

 

I used AAd Token to embed reports on my pages(For more details please check: https://stackoverflow.com/questions/50156057/steps-to-integrate-powerbi-report-on-java-application)

 

txtAccessToken is aad token.

txtEmbedUrl is the report that needs to be embedded. It will be like https://app.powerbi.com/reportEmbed?reportId.......

 var config= {                     
type
: 'report',
tokenType
: 0,//1:Embed,0:Aad

accessToken
: txtAccessToken,
embedUrl
: txtEmbedUrl,

permissions
: 7,
viewMode
: 0,
settings
: {
filterPaneEnabled
: false,
navContentPaneEnabled
: false,
useCustomSaveAsDialog
: false
}
};

var $reportContainer = $('#reportContainer'); var report = powerbi.embed($reportContainer.get(0), config);

 

Anonymous
Not applicable

@ashorekumar : i am just starting on poerbi embeeded . can you help with me with where to start on lease

v-ljerr-msft
Microsoft Employee
Microsoft Employee

Hi @mozakkir1,

 

Followings are some similar threads. Could you go to check if it helps in your scenario? Smiley Happy

https://github.com/Microsoft/PowerBI-JavaScript/issues/213

https://www.reddit.com/r/PowerBI/comments/6vip69/trying_to_generate_embed_token_via_javascript/?st=j...

 

Regards

mozakkir1
New Member

Any help??

or shall I raise this under some other category

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.