Get-AzRoleDefinition

In this Azure PowerShell article, we will discuss the syntax and usage of the Get-AzRoleDefinition Azure PowerShell cmdlet. Along with that, we will also discuss the implementation with examples.

Get-AzRoleDefinition

Get-AzRoleDefinition is an excellent Azure PowerShell cmdlet that can help you to retrieve the list of Azure RBAC roles that are available that you can assign.

Syntax

Below is the syntax of the Get-AzRoleDefinition Azure PowerShell cmdlet.

Get-AzRoleDefinition
Get-AzRoleDefinition   [[-Name] <String>]

Let’s discuss some implementation examples of the Get-AzRoleDefinition PowerShell command.

Example-1:

Get-AzRoleDefinition

After executing the above PowerShell command, I got the lists of Azure RBAC roles that are available.

You can see the output here

Get-AzRoleDefinition

Example-2:

You can also execute the below Azure PowerShell command to get the specified role definition i.e Automation Job Operator.

Get-AzRoleDefinition -Name "Automation Job Operator"

After executing the above PowerShell command I got the below output.

PS C:\WINDOWS\system32> Get-AzRoleDefinition -Name "Automation Job Operator"


Name             : Automation Job Operator
Id               : 4fe576fe-1146-4730-92eb-48519fa6bf9f
IsCustom         : False
Description      : Create and Manage Jobs using Automation Runbooks.
Actions          : {Microsoft.Authorization/*/read, Microsoft.Automation/automationAcc
                   ounts/hybridRunbookWorkerGroups/read, 
                   Microsoft.Automation/automationAccounts/jobs/read, 
                   Microsoft.Automation/automationAccounts/jobs/resume/action...}
NotActions       : {}
DataActions      : {}
NotDataActions   : {}
AssignableScopes : {/}

You can see the output here as below

get-azroledefinition scope

Get-AzRoleDefinition – Video Tutorial

You may also like following the below articles

Wrapping Up

In this Azure article, we have discussed the syntax and usage of the Get-AzRoleDefinition Azure PowerShell cmdlet with examples. Thanks for reading this article !!!