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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register 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
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.