Vijayanath Viswanathan
Vijayanath Viswanathan

Reputation: 8571

Keyword not supported: @microsoft.keyvault

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

Upvotes: 5

Views: 8189

Answers (4)

Christh
Christh

Reputation: 557

In our case, it was due to the App Service not having permissions to that KeyVault item. The App Service App Settings does give a visible warning (a red cross on the setting) if it can't access it - so that helped us diagnose.

Upvotes: 0

Ashutosh Gupta
Ashutosh Gupta

Reputation: 176

This issue occurred while testing on local. It was resolved after doing an az login.

Upvotes: 0

Tuukka Haapaniemi
Tuukka Haapaniemi

Reputation: 1274

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.

Upvotes: 5

Joey Cai
Joey Cai

Reputation: 20127

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.

Upvotes: 1

Related Questions