microsoft / microsoft/powerbi-powershell

Export-PowerBIReport Is not working as admin

Open
#65 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C#
Stars
413
Forks
134
Avg merge
33m
Merged PRs (30d)
1

Description

I'm running Export-PowerBIReport as global admin and I'm receiving an 'Unauthorized' error (full error below) for reports in workspaces I am not assigned or other user's personal workspaces. I can list all the reports in all the personal workspaces of other people though. We are in the middle of the transition process to GCC from the public tenant, it would be nice to export all of our user's content from the public tenant before we lose access.

RequestId : cc691c42-e5fa-4919-976f-846d8a1acf7c
Response : Unauthorized (401): {"error":{"code":"PowerBINotAuthorizedException","pbi.error":{"code":"PowerBINotAuthorizedException","parameters":{},"details":[],"exceptionCulprit":1}}}
PowerBIErrorInfo :
ResponseDate : Thu, 09 Aug 2018 07:13:34 GMT
RequestMethod : GET
RequestUri : https://api.powerbi.com/v1.0/myorg/reports/46590729-0131-46a5-b702-bde21ed9033e/Export
InvocationInfo : {Export-PowerBIReport}
Line : Get-PowerBIReport -WorkspaceId 'df5e1412-b279-4955-988e-6917af3d02ac' -Scope Organization | %{Export-PowerBIReport -Id $.id -OutFile D:\ner.pbix }
Position : At line:1 char:96
+ ... rganization | %{Export-PowerBIReport -Id $
.id -OutFile D:\ner.pbix }
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
StackTrace : at Microsoft.PowerBI.Api.V2.Reports.d__9.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.PowerBI.Api.V2.ReportsExtensions.d__29.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.PowerBI.Api.V2.ReportsExtensions.ExportReport(IReports operations, String reportKey)
at Microsoft.PowerBI.Common.Api.Reports.ReportsClient.ExportReport(Guid reportId, Nullable`1 workspaceId)
at Microsoft.PowerBI.Commands.Reports.ExportPowerBIReport.ExecuteCmdlet()
at Microsoft.PowerBI.Commands.Common.PowerBICmdlet.ProcessRecord()
HistoryId : 173

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Export-PowerBIReport invocation and the preceding Get-PowerBIReport command shown in the issue. Reproduce the GET request to the Power BI reports export endpoint using the reported workspace and report scope, then determine whether global-admin access should permit this export. Done means the authorization behavior is explained and the cmdlet or its documentation reflects the supported result.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.