The example JSON should follow the Role Definitions - Create Or Update REST API spec, and also use camelCase, instead of PascalCase.
These properties don't match their REST equivalents:
"Name": "Virtual Machine Operator",
"Id": "88888888-8888-8888-8888-888888888888",
The mapping is
| This doc | REST spec | Definition
|----------|---------------------|-------------
| Name | properties.roleName | The literal name, like Virtual Machine Operator
| Id | name | A GUID, like 6134dd49-621f-4c59-94db-a56b3f7e45f8
| - | id | A resource ID, like /subscriptions/subID/providers/Microsoft.Authorization/roleDefinitions/6134dd49-621f-4c59-94db-a56b3f7e45f8
This causes lots of confusions, including the help messages from az role definition create --help and az role definition update --help which follow this doc but don't comply with the REST spec.
⚠Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
@jiasli Thanks for your comment. We are actively investigating and will get back to you shortly.
The inconsistency also caused the confusion at https://github.com/MicrosoftDocs/azure-docs/issues/34334. We should stick with the new ARM style and eliminate the unnecessary manual transformation.
@jiasli Thanks for analysis and valuable feedback.
@rolyon Can you please review the issue and update the document accordingly?
Hi @jiasli
Thanks for your feedback. This example shows the capping for PowerShell, which most customers use. I will update the docs to make this more clear.
thanks
Hi @jiasli
We published a doc update that hopefully makes this more clear.
https://docs.microsoft.com/en-us/azure/role-based-access-control/custom-roles
If you have any additional feedback, feel free to reopen this issue.
thanks
@rolyon, the update looks great! Azure CLI will switch to the one in REST spec in the future. At least, it is now clearer for the users.