azure-sdk-for-net
azure-sdk-for-net copied to clipboard
[BUG] Cannot list role assignments directly from a resource scope
Library name and version
Azure.ResourceManager.Authorization 1.0.0-beta.1
Describe the bug
When retrieving a generic ArmResource with the ArmClient, the extention method call to list all RoleAssignments on that resource are not working.
var ResourceIdentifier = new Azure.Core.ResourceIdentifier(ResourceId);
ArmResource armResource = await armClient.GetGenericResource(ResourceIdentifier).GetAsync();
AsyncPageable<RoleAssignmentResource> roleAssignments = armResource.GetRoleAssignments().GetAllAsync($"atScope()");
It works fine when trying to list role assignments for a ResourceGroupResource. so i believe this to be a bug?
Expected behavior
expected to retrive a list of role assignments directly assigned on that resource (List of AsyncPageable<RoleAssignmentResource>
)
Actual behavior
throws the following error "Value cannot be empty or contain only white-space characters. (Parameter 'resourceType')"
Reproduction Steps
var ResourceIdentifier = new Azure.Core.ResourceIdentifier(ResourceId);
ArmResource armResource = await armClient.GetGenericResource(ResourceIdentifier).GetAsync();
AsyncPageable<RoleAssignmentResource> roleAssignments = armResource.GetRoleAssignments().GetAllAsync($"atScope()");
Environment
.NET 6.0 Visual Studio 2022 (17.2.5)
Thank you for your feedback. Tagging and routing to the team member best able to assist.
I tried with Azure.ResourceManager.Authorization 1.0.0
and cannot reproduce the issue. Please use the stable version and try again.
Hi, we're sending this friendly reminder because we haven't heard back from you in 7 days. We need more information about this issue to help address it. Please be sure to give us your input. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!