Skip to content

Instantly share code, notes, and snippets.

@iamNoah1
Last active November 24, 2020 15:35
Show Gist options
  • Save iamNoah1/4c09a91a21b3ea3e6d5b82b8c6c91822 to your computer and use it in GitHub Desktop.
Save iamNoah1/4c09a91a21b3ea3e6d5b82b8c6c91822 to your computer and use it in GitHub Desktop.
Create Role Assignments
clientId=`az aks show --name myk8s --resource-group aks2akvrg |jq -r .identityProfile.kubeletidentity.clientId`
nodeResourceGroup=`az aks show --name myk8s --resource-group aks2akvrg |jq -r .nodeResourceGroup`
subId=`az account show | jq -r .id`
az role assignment create --role "Managed Identity Operator" --assignee $clientId --scope /subscriptions/$subId/resourcegroups/aks2akvrg
az role assignment create --role "Managed Identity Operator" --assignee $clientId --scope /subscriptions/$subId/resourcegroups/$nodeResourceGroup
az role assignment create --role "Virtual Machine Contributor" --assignee $clientId --scope /subscriptions/$subId/resourcegroups/$nodeResourceGroup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment