Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
PowerShell Script to Create Azure Custom RBAC Role
CD $HOME
wget https://gist.githubusercontent.com/gsuttie/9fc7736ebf06371a601218902adee770/raw/9d007ccb7fc367bf26a3b3d6c71fa11b3b5ffa85/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
You can’t perform that action at this time.