I have seen other posts on this, but none of the answers seem to work. I have an azure function app that I am developing locally. It uses an app setting to get username/password from the key vault. When deployed to azure, it works perfectly. But developing locally, it is not grabbing the data from the vault.
So in code, I have this :
var password = System.Environment.GetEnvironmentVariable("PASSWORD", EnvironmentVariableTarget.Process);
I have added my user onto the vault access policy, and added the app identity on there also. Which is why it works in azure. I saw this post that mentions setting an environment variable : https://github.com/Azure/azure-functions-host/issues/3907 I tried that, but still no dice. Whenever I call the above code, I just get the setting key back, which looks like this :
@Microsoft.KeyVault(SecretUri=https://mykeyvault.vault.azure.net/secrets/PASSWORD/e97ba4bf3e2e4919b1899384ea349999)