Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi folks,
I am facing issue while uploading a PBIX file from local storage using import API. Code is in nodejs. Please find snipshot below
let options = {
method: 'POST',
headers: {
'Content-Type': 'multipart/form-data',
'authorization': 'Bearer ' + authToken
},
body: fs.createReadStream(filePathOnLocal + 'report.pbix'),
url: `https://api.powerbi.com/v1.0/myorg/groups/${group_id}/imports?datasetDisplayName=report.pbix&nameConflict=CreateOrOverwrite`
};
const result = await axios.request(options)
It is giving me error
I had found same code in other post, but not sure why I am facing this issue.
Also for verify if file is correct or not, I have called PBI API directly from Postman with same file and it successfully upload the file on desired group. Only for code it is failing
Solved! Go to Solution.
Issue fixed, from one of the post I come to know that Content-Lenght is required to append in headers.
Attaching link of that post
'Post in Group' API using Nodejs - Microsoft Fabric Community
Happy sharing
One more observation, with axios only we have to do these changes. Because I have tried with request library(depricated in nodejs) also and it works fine.
Issue fixed, from one of the post I come to know that Content-Lenght is required to append in headers.
Attaching link of that post
'Post in Group' API using Nodejs - Microsoft Fabric Community
Happy sharing
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
6 | |
5 | |
4 | |
4 | |
4 |