Remove-AzRoleAssignment : Multiple role definitions found with name ''
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 62/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- azure, csharp, powershell
- Domain
- authorization, cli, cloud
Research direction
Start in RemoveAzureRoleAssignmentCommand.cs at the InputObject parameter-bound block and reproduce the failure with multiple role assignments whose RoleDefinitionName is empty. Trace how the input object's role definition identifier is handled there, then verify that piping the assignment to Remove-AzRoleAssignment succeeds without the ambiguous-name error.
Written by the indexing model from the issue text.
Description
Description
If a scope has multiple role assignments with an empty RoleDefinitionName, then Remove-AzRoleAssignment will fail with the following error:
PS C:\Users\kwill> $DeprecatedAccounts[0] | Remove-AzRoleAssignment
Remove-AzRoleAssignment : Multiple role definitions found with name ''. Specify role definition using it's Id instead.
At line:1 char:26
$DeprecatedAccounts[0] | Remove-AzRoleAssignment
~~~~~~~~~~~~~~~~~~~~~~~
CategoryInfo : CloseError: (:) [Remove-AzRoleAssignment], InvalidOperationException
FullyQualifiedErrorId : Microsoft.Azure.Commands.Resources.RemoveAzureRoleAssignmentCommand
To fix, RemoveAzureRoleAssignmentCommand.cs should include the roleDefinitionId in this section of code:
if (this.IsParameterBound(c => c.InputObject))
{
Scope = InputObject.Scope;
ObjectId = InputObject.ObjectId;
RoleDefinitionName = InputObject.RoleDefinitionName;
}
- Dominant language
- C#
- Stars
- 4.8k
- Forks
- 4.3k
- Avg merge
- 3d 21h
- Merged PRs (30d)
- 49
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.
More from Azure/azure-powershell
-
[Feature]: Opencustomer-reported feature-request needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Azure/azure-powershell#30135 ·
-
customer-reported feature-request
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Azure/azure-powershell#30100 ·
-
Get-AzCognitiveServicesModelCapacity does not support querying models with the Format "Mistral AI" Openbug customer-reported
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Azure/azure-powershell#29632 · 1 reaction ·
-
bug customer-reported needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Azure/azure-powershell#29615 ·
-
bug customer-reported
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Azure/azure-powershell#29540 · 1 comment · 2 reactions ·
All issues in Azure/azure-powershell
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:auth FE mvp P3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
klasolsson81/jobbliggaren#1788 ·