microsoft / microsoft/powerbi-powershell
Add-PowerBIWorkspaceUser BadRequest when AccessRight is Member or Contributor
Nobody has claimed this yet.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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