microsoft / microsoft/powerbi-powershell

Add-PowerBIWorkspaceUser BadRequest when AccessRight is Member or Contributor

Open
#95 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Hello,

When I try to add a user to a workspace with the command:
Add-PowerBIWorkspaceUser -Id [id] -UserEmailAddress [emailaddress] -AccessRight Member
or:
Add-PowerBIWorkspaceUser -Id [id] -UserEmailAddress [emailaddress] -AccessRight Contributor

I get the following error:

Add-PowerBIWorkspaceUser : Operation returned an invalid status code 'BadRequest'
At line:1 char:1

  • Add-PowerBIWorkspaceUser -Id ..... -Us ...
  •   + CategoryInfo          : WriteError: (Microsoft.Power...BIWorkspaceUser:AddPowerBIWorkspaceUser) [Add-PowerBIWorkspaceUser], HttpOperationException
      + FullyQualifiedErrorId : Operation returned an invalid status code 'BadRequest',Microsoft.PowerBI.Commands.Workspaces.AddPowerBIWorkspaceUser
    
    

The command works fine when I add the user as Admin. But I don't want the user to be Admin, I want to set the AccessRight to Member.

What is going wrong?

Thanks,

Marc

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 Add-PowerBIWorkspaceUser command and reproduce the BadRequest using AccessRight Member and Contributor, then compare it with Admin. Check whether the command or the Power BI API rejects those values; done means supported non-Admin access rights work or the command reports a clear reason for rejection.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp, powershell
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 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.