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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
mallikarjunTH
Regular Visitor

Seamless Login to a Power BI report from a web application to open a report in a separate window

Hi,

 

We are working on a requirement to provide a hyperlink to the customer's power bi report url in our application and allow seamless navigation to the report without prompting for login. Our application is hosted in aws. If anyone has tried anything similar please provide suggesstions.

2 REPLIES 2
V-lianl-msft
Community Support
Community Support

What you need is Power BI Embedded solution. Here's the link to documentation to get started.

There are a number of steps you need to take:

  1. Create a Workspace Collection inside Azure and get the Access keys (I understand you've completed this)
  2. Create a Workspace using the REST API - with PHP, you'll be using probably use CURL for this. Don't forget to add the Authorization header with one of the Access keys and use POST as described here. Note that you don't need to actually post anything, just use the POST method, otherwise you'll just get a JSON with the existing workspaces. POST https://api.powerbi.com/v1.0/collections/mypbiapp/workspaces Authorization: AppKey {yourAccessKey}

Now you should have a workspace id.

  1. Import a .pbix file from Power BI Desktop into your workspace. This is also achieved using the REST API. don't forget to add the datasetDisplayName parameter to the URL, ie: POST the data and file to https://api.powerbi.com/v1.0/collections/{collectionName}/workspaces/{workspaceId}/imports?datasetDi...}

Now you should have a report id.

  1. Create an embed token. This is a JSON Web Token (JWT). You can use php-jwt for this. The JWT claims payload required for PBIe are listed here. Note that you only need to pass the payload and your Access key to php-jwt.
  2. With that token, you can finally embed the report in your application using PowerBI Javascript. You can just copy the powerbi.js file from the dist dir if you wish. You need to create a configuration object as described here. var embedConfiguration = { type: 'report', accessToken: {your-jwt-token-string}, id: {your-report-id-string}, embedUrl: 'https://embedded.powerbi.com/appTokenReportEmbed' }; var $reportContainer = $('#reportContainer'); //some div var report = powerbi.embed($reportContainer.get(0), embedConfiguration);

And now you should have a report in your app.

Hi thanks for the reply. Our requirement is not to embed the report in a web page.  Our requirement is to have a service principal user created in Azure through app registration and use the clientid and secret of this user to get the embedded token. We also want to pass an additional paramter in the report url such that the logged in user's email id so that when the user from our application clicks on the report link it should use that parameter and show him as the logged in user in the power bi application also. It is possible to achieve?

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.