Forum Discussion
Unauthorized error when publishing pbix to PowerBI service using PowerShell cmdlet
When publishing several pbix files to PowerBI service using the New-PowerBIReport command in Powershell (cmdlet MicrosoftPowerBIMgmt), I am randomly getting following error for some files:
"Operation returned an invalid status code 'Unauthorized'"
I got the account assigned a PowerBI Pro licenses yesterday, it has been over 12 hours since the license was assigned so I would expect it to work now. I was able to publish files fine earlier with a trial license.
Why would some reports get published and others not, when using the same ps session? Any way to resolve this?
I checked the service status page and there are no service outages/issues reported.
I am logged in with the correct account in Powershell.
This got resolved my itself after 2 days. I stopped getting the Unauthorized response even when publishing multiple reports.
It almost feels like my publish report requests from ps are going to different PBI servers, and some servers could not validate that I have a valid Pro license. I cannot say for sure what was wrong though.
1 Reply
- ramit-rulzFrequent Visitor
This got resolved my itself after 2 days. I stopped getting the Unauthorized response even when publishing multiple reports.
It almost feels like my publish report requests from ps are going to different PBI servers, and some servers could not validate that I have a valid Pro license. I cannot say for sure what was wrong though.