microsoft / microsoft/powerbi-powershell

Copy-PowerBITile Does not work with Service Principal

Open
#236 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Using the following command files while authenticating via Service Principal but it works when authenticated with an user. (given proper access)
Copy-PowerBITile -WorkspaceId $SrcWorkspace.Id.Guid -DashboardId $SrcDashBoard.Id.Guid -TileId $tile.Id -TargetDashboardId $TgtDashboard.Id.Guid -TargetWorkspaceId $TgtWorkspace.Id.Guid -TargetReportId $TgtReport.Id.Guid -TargetDatasetId $TgtDataset.Id.Guid

DEBUG: 10:46:29 AM - Cmdlet version: 1.0.840.0
Copy-PowerBITile : Operation returned an invalid status code 'Unauthorized'
At line:1 char:1
+ Copy-PowerBITile -WorkspaceId $SrcWorkspace.Id.Guid -DashboardId $Src ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (Microsoft.Power...CopyPowerBITile:CopyPowerBITile) [Copy-PowerBITile], HttpOperationException
    + FullyQualifiedErrorId : Operation returned an invalid status code 'Unauthorized',Microsoft.PowerBI.Commands.Reports.CopyPowerBITile

VERBOSE: Status Code: Unauthorized (401)
DEBUG: 10:46:31 AM - Copy-PowerBITile end processing.

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 by reproducing Copy-PowerBITile with the command and service-principal authentication shown in the issue, then compare it with the working user-authenticated case. Trace the cmdlet's Power BI request and authentication path to identify why it returns 401. Done means the same tile-copy operation succeeds with a service principal that has the stated access, with coverage for the failing authentication path.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
api, authentication
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.