Skip to content

Instantly share code, notes, and snippets.

@marcduiker
Last active June 24, 2020 08:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcduiker/0c17b62aecc3400c2fff798f2e458a6e to your computer and use it in GitHub Desktop.
Save marcduiker/0c17b62aecc3400c2fff798f2e458a6e to your computer and use it in GitHub Desktop.
Azure CLI to add an access policy for a Function App to KeyVault
$principalId = az functionapp identity show -n FUNC_APP_NAME -g RESOURCE_GROUP_NAME --query principalId
$appId = az ad sp show --id $principalId --query appId
az keyvault set-policy -n KEYVAULT_NAME --spn $appId --secret-permissions get
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment