Last active
July 8, 2020 18:38
-
-
Save gsuttie/3b339a128eac2613d0eafa025bb6f5db to your computer and use it in GitHub Desktop.
PowerShell Script to Create Azure Custom RBAC Role
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
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