azure-sdk-for-net icon indicating copy to clipboard operation
azure-sdk-for-net copied to clipboard

[BUG] Cannot list role assignments directly from a resource scope

Open shareonline opened this issue 2 years ago • 2 comments

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)

shareonline avatar Aug 05 '22 19:08 shareonline

Thank you for your feedback. Tagging and routing to the team member best able to assist.

jsquire avatar Aug 05 '22 21:08 jsquire

I tried with Azure.ResourceManager.Authorization 1.0.0 and cannot reproduce the issue. Please use the stable version and try again.

fengzhou-msft avatar Oct 21 '22 06:10 fengzhou-msft

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!

ghost avatar Jan 17 '23 14:01 ghost