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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

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
Community Champion
Community Champion

@Anonymous 

 

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!


Anonymous
Not applicable

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
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.

Top Solution Authors