2
votes

I was trying to get the connection string from the azure key vault for azure functions. These are the steps I did,

  1. Created a managed identity(System assigned) in the azure functions

  2. Create a secret in an azure key vault

  3. Add access policies to give permission to the azure function app
  4. Added an entry in the app settings for connection string where the value was @Microsoft.KeyVault(SecretUri=SECRETURLOFKEYVAULT)

But when I run the azure function I am getting below error,

"Keyword not supported: @microsoft.keyvault(secreturi....."

This is how I have enabled managed identity,

enter image description here

And my access policy looks like below,

enter image description here

Any help would be much appreciated

2
Can you confirm that the access policy is against the managed identity and that you did not configure the "authorized application" section of the policy?mattchenderson

2 Answers

1
votes

According to the steps you provided, it have no problem to work well. Here is the tutorial about get key vault secrets in Azure Function you could refer to.

Note: Add access policies to the azure function app with the Get permission on secrets and that was enough.

Also, here is a similar issue that get same error like you which is due to IP Address restriction blocking it.

1
votes

I ran into a similar problem by following the tutorial. My remedy was a restart of the function app. Saving of the app setting was not enough for the Function App to start using the Key Vault secret provider correctly.