Skip to content

Idempotency of az role assignment create is not working #31995

@nasusoba

Description

@nasusoba

Describe the bug

The az role assignment create command used to implement the idempotency, it means when the role assignment already exists, it will return the existing role assignment without error. It was implemented here. However, recently, I am seeing the idempotency assumption is broken.

Related command

az role assignment create

Errors

az role assignment create --assignee 292fc6f0-c845-4f60-9b2a-84253e963e2c --role "Key Vault Contributor" --scope /subscriptions/【mysub】/resourceGroups/[myrg]/providers/Microsoft.KeyVault/vaults/[mykv]--only-show-errors

(RoleAssignmentExists) A role assignment with ID '0b24f0d38ec546f5a10b26557bb60958' already exists with the same scope, principal ID, and role definition ID.
Code: RoleAssignmentExists
Message: A role assignment with ID '0b24f0d38ec546f5a10b26557bb60958' already exists with the same scope, principal ID, and role definition ID.

Issue script & Debug output

log.txt

Expected behavior

Succeeds and return the role assignment list result

Environment Summary

{
"azure-cli": "2.76.0",
"azure-cli-core": "2.76.0",
"azure-cli-telemetry": "1.1.0",
"extensions": {
"account": "0.2.5",
"aksarc-lm": "0.9.1",
"arcappliance": "1.5.0",
"arcdata": "1.5.25",
"azure-devops": "1.0.2",
"connectedk8s": "1.10.8",
"customlocation": "0.1.4",
"k8s-configuration": "2.2.0",
"k8s-extension": "1.6.7",
"k8s-runtime": "2.0.0",
"providerhub": "1.0.0b2"
}
}

Additional context

No response

Metadata

Metadata

Assignees

Labels

Auto-AssignAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamPossible-SolutionRBACaz roleSimilar-IssuequestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions