Reputation: 8571
I was trying to get the connection string from the azure key vault for azure functions. These are the steps I did,
Created a managed identity(System assigned) in the azure functions
Create a secret in an azure key vault
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,
And my access policy looks like below,
Any help would be much appreciated
Upvotes: 5
Views: 8189
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
Reputation: 176
This issue occurred while testing on local. It was resolved after doing an az login
.
Upvotes: 0
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
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