azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

Get-AzRoleAssignment doesn't return role name if subscription is specified

Open sarah026 opened this issue 5 years ago • 4 comments

Hello

I'm trying to loop over a list of subscriptions for all role assignments.

If within the context I'm in I do $ Get-AzRoleAssignment

I get the following fields all populated DisplayName ObjectId ObjectType RoleDefinitionName Scope

But if I do $ Get-AzRoleAssignment -SubscriptionId $s.Id

The RoleDefinitionName field is blank!

am I missing something? Thanks

PS C:\WINDOWS\system32> get-module -Name Az.Resources

ModuleType Version Name ExportedCommands


Script 4.0.2 Az.Resources {Add-AzADApplicationOwner, Add-AzADGroupMember, Add-AzADGroupOwner, Export-AzDeploymentTemplate...}

sarah026 avatar May 23 '21 21:05 sarah026

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @armleads-azure.

Issue Details

Hello

I'm trying to loop over a list of subscriptions for all role assignments.

If within the context I'm in I do $ Get-AzRoleAssignment

I get the following fields all populated DisplayName ObjectId ObjectType RoleDefinitionName Scope

But if I do $ Get-AzRoleAssignment -SubscriptionId $s.Id

The RoleDefinitionName field is blank!

am I missing something? Thanks

PS C:\WINDOWS\system32> get-module -Name Az.Resources

ModuleType Version Name ExportedCommands


Script 4.0.2 Az.Resources {Add-AzADApplicationOwner, Add-AzADGroupMember, Add-AzADGroupOwner, Export-AzDeploymentTemplate...}

Author: sarah026
Assignees: -
Labels:

ARM - RBAC, Service Attention, customer-reported, needs-triage, question

Milestone: -

ghost avatar May 24 '21 15:05 ghost

Hi @sarah026 , Apologies for the delayed response. I see that this issue was opened a while ago and no further activity had taken place. So wanted to check if you are still looking for assistance on this query or the issue was resolved? Please let us know .

Thank you

KranthiPakala-MSFT avatar Oct 23 '21 21:10 KranthiPakala-MSFT

Hi @sarah026 We still have not heard back from you. Just wanted to check if you still need assistance on this? Please let us know

Thanks

KranthiPakala-MSFT avatar Oct 27 '21 22:10 KranthiPakala-MSFT

We will now proceed to close this thread as we have not heard back from you. If there are further questions please feel free to open a new issue. We will gladly continue the discussion.

Thank you

KranthiPakala-MSFT avatar Oct 28 '21 19:10 KranthiPakala-MSFT