What am I doing wrong trying to set the following in my Functions v2 app settings.
@Microsoft.KeyVault(SecretUri=<uri>)
Reading this inside the function I get the full string out and not the connection string from the key vault as I expected.
var config = new ConfigurationBuilder()
.SetBasePath(context.FunctionAppDirectory)
.AddJsonFile("local.settings.json", optional: true, reloadOnChange: true)
.AddEnvironmentVariables()
.Build();
var value = config["cstring"];
var connectionString = Environment.GetEnvironmentVariable("cstring");
log.Info(value); // Prints "@Microsoft.KeyVault(SecretUri=<uri>)"
log.Info(connectionString); // Prints "@Microsoft.KeyVault(SecretUri=<uri>)"
Do I need to take more steps?
The function as an MSI which has access to the key vault.
Multiple tutorials online make this seem so easy and working out of the box.