-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Idempotency of az role assignment create is not working #31995
Copy link
Copy link
Closed
Labels
Auto-AssignAuto assign by botAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamThe command of the issue is owned by Azure CLI teamPossible-SolutionRBACaz roleaz roleSimilar-IssuequestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
Milestone
Metadata
Metadata
Assignees
Labels
Auto-AssignAuto assign by botAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamThe command of the issue is owned by Azure CLI teamPossible-SolutionRBACaz roleaz roleSimilar-IssuequestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
Describe the bug
The
az role assignment createcommand 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 createErrors
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