Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mikepfeiffer/53453a98d62991dfdb5da40beb6229d5 to your computer and use it in GitHub Desktop.
Save mikepfeiffer/53453a98d62991dfdb5da40beb6229d5 to your computer and use it in GitHub Desktop.
PowerShell Script to Create Azure Custom RBAC Role
CD $HOME
wget https://gist.github.com/mikepfeiffer/176776a8758b4e2910554a5c33392c12/raw/e48369b8aa73348606e76cbebc603d9e89c56666/customRoleDefinition.json
$subscription_id = (Get-AzContext).Subscription.id
(Get-Content -Path $HOME/customRoleDefinition.json) -Replace 'SUBSCRIPTION_ID', $subscription_id |
Set-Content -Path $HOME/customRoleDefinition.json
New-AzRoleDefinition -InputFile ./customRoleDefinition.json
Get-AzRoleDefinition -Name 'Virtual Machine Operator (Custom)'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment