Created
April 27, 2020 12:08
-
-
Save mikepfeiffer/53453a98d62991dfdb5da40beb6229d5 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.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