Luiso
Luiso

Reputation: 4113

Azure Functions V1 user secrets

I am new to Azure Functions and I need to develop a few V1 (.Net Framework) functions that will have connections strings and other secrets that I cannot add to source control, I have to use V1 because I will need to use some libraries only available on classic .net

I have seen several articles on how to use secrets with V2 and V3 (.net core) and I have seen some advising to install Microsoft.Configuration.ConfigurationBuilders.UserSecrets following the directions on the project site and this tutorial mentioned on that site

So basically what I'm supposed to do is having an app.config file then create sections that will map to the proper Builder on app startup, however, azure functions don't seem to work with config files, I have created and tested and whenever I call System.ConfigurationManager.AppSettings it loads what is on the local.settings.json file. I don't see anywhere this can be changed.

So summing up, what I'm trying to do is have a file with some config in dev and then use Azure Key Vault once deployed.

How can I do this?
Is there a way to use a config file with Azure functions?

Upvotes: 1

Views: 292

Answers (1)

Gregory A Beamer
Gregory A Beamer

Reputation: 17010

I vote for "put the secrets in key vault". This should work for any version.

Upvotes: 2

Related Questions