Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export-PowerBIReport returns Unauthorized #88

Open
aabundez opened this issue Oct 31, 2018 · 6 comments
Open

Export-PowerBIReport returns Unauthorized #88

aabundez opened this issue Oct 31, 2018 · 6 comments
Assignees
Labels
bug Something isn't working external bug Bug in something external such as an API

Comments

@aabundez
Copy link

I am the admin for a Workspace (original workspace paradigm, not new one) and I cannot run the Export-PowerBIReport cmdlet. It keeps returning Unauthorized. I also have the Power BI Administrator role and am the owner of this particular O365 group. I am also a Global Administrator in O365.

I can run all the other Get cmdlets for the entire Organization. It's just Export-PowerBIReport which is giving me problems. I've assigned all the rights I know about. Let me know if there's anything else I can do to troubleshoot the issue.

image

@aabundez
Copy link
Author

Quick update. I was able to use Invoke-PowerBIRestMethod and the Export Reports In Groups endpoint just fine. So it's not a permissions issue.

Invoke-PowerBIRestMethod -Url 'groups/{groupId}/reports/{reportKey}/export' -Method Get -OutFile "C:/filename.pbix"

@CodeCyclone
Copy link
Collaborator

Can you add the -Verbose flag to Export-PowerBIReport and execute Resolve-PowerBIError -Last and paste the result here?
The code is invoking the Power BI SDK, there might be a bug there.

@CodeCyclone CodeCyclone self-assigned this Nov 26, 2018
@CodeCyclone CodeCyclone added the bug Something isn't working label Nov 26, 2018
@sqlchick
Copy link

I can add that I'm seeing this as well -- but only with a V1 workspace. Each of my V2 workspaces behave as expected. When executing Export-PowerBIReport on a V1 workspace, it returns unauthorized even though I'm an admin on the workspace itself & can export the PBIX from the portal without any issues. So I agree this seems like a bug. I get the same result using a client tool (like PowerShell ISE or VSCode) & the same using Cloud Shell in the Azure portal.
powershellerror

@CodeCyclone CodeCyclone added the external bug Bug in something external such as an API label Nov 27, 2018
@robertplata
Copy link

Is there an update as to whether the export-powerbireport cmdlet has a bug? I am receiving the same unauthorized error. I was unable to use Invoke-PowerBIRestMethod. Thanks

@sagarkul
Copy link

Export-PowerBIReport -Scope Organization -Id $sourceReportId -OutFile "$filePath"
Above line works with service principal

@ManuelWernerbtelligent
Copy link

In my case this works only if i add the workspace guid in the cmdlet.

Export-PowerBIReport -WorkspaceId {GUID} -Id {ID} -OutFile C:\Users\Downloads<Filename>.pbix

Second solution is to move to the Invoke-PowerBIRestMethod and the Export Reports In Groups like @aabundez mentioned.

Best

Manuel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working external bug Bug in something external such as an API
Projects
None yet
Development

No branches or pull requests

6 participants