I have an Azure Functions app that I'm testing locally but it doesn't appear to be picking up my local.settings.json
configuration. I had to manually create the file since I've cloned this solution from my github repo (local.settings.json is set to ignore by default). I'm wondering if that's the issue and there's some way I'm not linking it to the project?
Update:
Since it is not the key. try to add json file to env on hand. Add a Startup class to your functionapp.
public class Startup : IWebJobsStartup
{
public void Configure(IWebJobsBuilder builder)
{
var config = new ConfigurationBuilder()
.AddJsonFile("local.settings.json", optional: true, reloadOnChange: true)
.AddEnvironmentVariables()
.Build();
}
}
Original Answer:
My guess is because this local.settings.json was created by yourself, so this file was not placed under the debug folder after compilation. Therefore, these values are not entered into the environment variables.
Based on this, I can give a solution, copy your local.settings.json file directly to the below folder, and then the problem should be solved.
(There should be a local.settings.json file here, otherwise the environment variables cannot be entered.)
Hope my inference is correct and hope this answer helps. :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With