Last active
December 13, 2020 13:55
-
-
Save iamNoah1/c219db9bab84449d7103158545423f5e to your computer and use it in GitHub Desktop.
set read permissions for key vault
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
clientId=`az identity show --name aks2kvIdentity --resource-group aks2akvrg |jq -r .clientId` | |
principalId=`az identity show --name aks2kvIdentity --resource-group aks2akvrg |jq -r .principalId` | |
subId=`az account show | jq -r .id` | |
az role assignment create --role "Reader" --assignee $principalId --scope /subscriptions/$subId/resourceGroups/aks2akvrg/providers/Microsoft.KeyVault/vaults/myk8skv | |
az keyvault set-policy -n myk8skv --secret-permissions get --spn $clientId | |
az keyvault set-policy -n myk8skv --key-permissions get --spn $clientId |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment