Skip to content

Conversation

@jiasli
Copy link
Member

@jiasli jiasli commented Dec 19, 2022

Related command
az role assignment create

Description
#24324 introduced --name for az role assignment create but is unclear about its type. This may lead to incorrect usages (#24919), as user can use invalid role assignment name, resulting in malformed URL and causing confusing service error (#7441).

Additional information
That help message originally was

The name of the role assignment to create. It can be any valid GUID.

Azure/azure-rest-api-specs#16639 updated it for 2020-04-01-preview API to

https://github.com/Azure/azure-rest-api-specs/blob/cf848c9f570c1157bbad81e214f5bb2993e578bb/specification/authorization/resource-manager/Microsoft.Authorization/preview/2020-04-01-preview/authorization-RoleAssignmentsCalls.json#L242

          {
            "name": "roleAssignmentName",
            "in": "path",
            "required": true,
            "type": "string",
            "description": "A GUID for the role assignment to create. The name must be unique and different for each role assignment."
          },

However, that change was reverted in 2022-04-01 API:

https://github.com/Azure/azure-rest-api-specs/blob/020f48c422ec455cdee9f6516f2d0172d13e77a3/specification/authorization/resource-manager/Microsoft.Authorization/stable/2022-04-01/authorization-RoleAssignmentsCalls.json#L693

    "RoleAssignmentNameParameter": {
      "name": "roleAssignmentName",
      "in": "path",
      "required": true,
      "type": "string",
      "description": "The name of the role assignment. It can be any valid GUID.",
      "x-ms-skip-url-encoding": true,
      "x-ms-parameter-location": "method"
    },

I am not sure why. It can be any valid GUID. is certainly not accurate. No matter how swagger describes it, at least we make it accurate.

@ghost ghost requested a review from yonzhan December 19, 2022 10:42
@ghost ghost added the Auto-Assign Auto assign by bot label Dec 19, 2022
@ghost ghost assigned jiasli Dec 19, 2022
@ghost ghost added the RBAC az role label Dec 19, 2022
@jiasli jiasli force-pushed the assignment_name branch 2 times, most recently from 96ba3a4 to b9c6a27 Compare December 19, 2022 10:59
@yonzhan
Copy link
Collaborator

yonzhan commented Dec 19, 2022

Role

@jiasli jiasli merged commit ce44693 into Azure:dev Jan 4, 2023
@jiasli jiasli deleted the assignment_name branch January 4, 2023 02:57
avgale pushed a commit to avgale/azure-cli that referenced this pull request Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Auto-Assign Auto assign by bot RBAC az role

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants