Forum Discussion

rkb2023's avatar
rkb2023
New Member
2 years ago

Help Needed with Power BI App Owns Data Integration in Node.js App - 400 Bad Request Error

Hello fellow Power BI enthusiasts,

I'm reaching out to the community in search of some much-needed assistance with a Power BI integration issue that has been giving me sleepless nights for the past four days. Any help or insights would be greatly appreciated!

Background: I've been working on a Power BI integration in a Node.js app, and initially, everything was running smoothly. However, I recently encountered a problem when I attempted to change the embedded report. Since then, I've been consistently getting a frustrating "400 Bad Request" error, and I'm at my wit's end trying to resolve it.

Here are some additional details:

  • I'm using a Premium Per User License for this integration.

  • To facilitate authentication, I've set up a service principal and a security group, and they've been added to the workspace for access.

  • Following the official documentation (https://learn.microsoft.com/en-us/power-bi/developer/embedded/embed-sample-for-customers?tabs=net-core#step-6---service-principal-api-access), I've allowed Power BI access in the Power BI admin portal.

  • This integration is built using Node.js, and it was functioning perfectly fine until I tried to embed another report.

  • All the necessary details, including the report ID, workspace ID, etc., are correctly configured in my config.json
    file.

  • The error seems to originate from within the getEmbedTokenForSingleReportSingleWorkspace
    function, particularly in the fetch request to obtain the embed token:

 

 

const result = await fetch(embedTokenApi, {

method: 'POST',

headers: headers,

body: JSON.stringify(formData)

});

 

 

 

I'm genuinely stumped by this issue and have been trying to troubleshoot it for days without success. If anyone has encountered a similar problem or has expertise in Power BI integration with Node.js, I would be immensely grateful for any insights, suggestions, or solutions you can offer.

1 Reply