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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
bingo
Microsoft Employee
Microsoft Employee

How to upload a new .pbix file to the workspace use service principle with powershell

I want to achieve CD in devops to upload the pbix file to the powerBI service use the release pipeline. Now I can get the workspace info use Get-PowerBIWorkspace -All, but meet 'unauthorized' error when use the New-PowerBIReport -Path "$($reportFile.Fullname)" -Name "$($reportFile.Basename)" -Workspace $destinationWorkspace -ConflictAction "Overwrite" -Timeout 2000. How to do, do you have any idea, thanks.

bingo_0-1703662919230.png

 

2 REPLIES 2
rubayatyasmin
Super User
Super User

@bingo 

 

That's like trying to get into a private party without an invite. Here's what you might wanna check:

  1. Permissions: Make sure your access pass (service principal) is the real deal and it's got the VIP pass to the Power BI workspace. It needs to be the boss to let your report in.

  2. Token: That's your secret handshake. If it's old or wrong, the door won't open. Make sure it's fresh and correct.

  3. Check the address: The workspace ID is like the party address. If it's wrong, you're knocking on the wrong door.

  4. Script Setup: Think of it like the car you drive there. Make sure it's got everything it needs to get you to the party – all the right credentials and stuff.

  5. Update Your Gear: If your PowerShell module is old school, it might not jive with the new Power BI moves. Get the latest version.

If you've checked all this and it's still a no-go, you might need to reset your handshake (token) or double-check you've got the right permissions.


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


Hi, thanks. I can login and get sccesstoken using service principle, and can get the workspace info through the command Get-PowerBIWorkspace -All, but faild when executing the command NewReport. Do you know whether the method is feasible, I am wondering whether it is feasible to achieving upload new report, as I see somewhere say the service principle can only access to read-only api.

Helpful resources

Announcements
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!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.