Created
July 30, 2019 12:49
-
-
Save iamsunny/541527f9b263daacda9707355b57ffb4 to your computer and use it in GitHub Desktop.
Create Custom Roles in Azure using Powershell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$role = [Microsoft.Azure.Commands.Resources.Models.Authorization.PSRoleDefinition]::new() | |
$role.Name = "Custom Role" | |
$role.IsCustom = $true | |
$role.Description = "Can perform assigned activities" | |
$perms = 'Microsoft.Compute/virtualMachines/read','Microsoft.Compute/virtualMachines/write' | |
$role.Actions = $perms | |
$role.assignableScopes = "/subscriptions/11111111-1111-1111-1111-111111111111" | |
New-AzRoleDefinition -Role $role |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment