Azure / Azure/azure-rest-api-specs-examples
Unable to GET Role Definition by Role Name
- Dominant language
- No language data
- Stars
- 40
- Forks
- 23
- Avg merge
- 23h 36m
- Merged PRs (30d)
- 172
Description
### Link to sample
https://learn.microsoft.com/en-us/rest/api/authorization/role-definitions
### Library name and version
github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/authorization/armauthorization
### Language of the Sample
- [X] C#/.NET
- [X] Java
- [X] JavaScript/TypedScript
- [X] Python
- [X] Golang
- [ ] Other - Please specify in Issue details field
### Sample Issue Type
- [ ] Sample not working
- [ ] Sample missing
- [X] Do not understand sample
### Issue details
Using the Azure CLI it is possible to obtain a role by its name like this: **az role definition list --name MyRoleName**
Using the API (or any SDK, since these use the API) I am only able to get roles by ID.
IDs are non-user-friendly Azure generated UUIDs.
### Expected behavior
API documentation for [Get](https://learn.microsoft.com/en-us/rest/api/authorization/role-definitions/get?tabs=HTTP) states that it "Gets a role definition by name", while [GetByID](https://learn.microsoft.com/en-us/rest/api/authorization/role-definitions/get-by-id?tabs=HTTP) "Gets a role definition by ID".
### Actual behavior
Both get the role by ID.
### Reproduction Steps
GET https://management.azure.com/{scope}/providers/Microsoft.Authorization/roleDefinitions/{roleDefinitionId}?api-version=2022-04-01
GET https://management.azure.com/roleDefinitionId?disambiguation_dummy&api-version=2022-04-01
### Environment
Any
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by comparing the linked Get and GetByID API documentation with the two reproduced management API requests. Determine whether the discrepancy is in the service behavior, API documentation, or Go SDK surface; done should clearly establish how role definitions can be retrieved by name or document the limitation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, go
- Domain
- api, cloud
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100