Skip to content

az role assignment create is NOT idempotent #25872

@mosharafMS

Description

@mosharafMS

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name
az synapse role assignment create

Errors:

(RoleAssignmentAlreadyExists) Role Assignment with roleId '6e4bf58a-b8e1-4cc3-bbf9-d73143322b78', principalId '1db446b3-dc3e-4eb5-b703-253431f879af' and scope 'workspaces/syntestadmin1982' within workspace 'syntestadmin1982' already exists.
Code: RoleAssignmentAlreadyExists
Message: Role Assignment with roleId '6e4bf58a-b8e1-4cc3-bbf9-d73143322b78', principalId '1db446b3-dc3e-4eb5-b703-253431f879af' and scope 'workspaces/syntestadmin1982' within workspace 'syntestadmin1982' already exists.

To Reproduce:

Run the role assignment command twice. First time it will succeed if this role wasn't assigned before, second time will fail because it already exists.

  • Put any pre-requisite steps here...
  • az synapse role assignment create --workspace-name {} --role {} --assignee {}

Expected Behavior

Not to fail but return the current assignment info. Similar to az role assignment to be idempotent to be used in automation.

Environment Summary

Windows-10-10.0.19044-SP0
Python 3.10.10
Installer: MSI

azure-cli 2.46.0

Extensions:
bastion 0.2.1

Dependencies:
msal 1.20.0
azure-mgmt-resource 21.1.0b1

Additional Context

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions