Closed ben-ward1 closed 2 days ago
@ben-ward1 local.settings.json
is not intended to be loaded through IConfiguration
. It is loaded by core tools and the values are supplied as environment variables to both the host and worker process.
Beyond that, we do not own .AddJsonFile
or auto reloading of IConfiguration
, this issue is better suited for dotnet/runtime repo. If you want config to auto-reload for the worker only, you can use a custom json file (such as appsettings.json
)
Closing as this is by design for local.settings.json
.
Description
Posting this here after getting no responses in this discussion.
The json configuration provider in a v4 Azure functions w/ dotnet 8 isolated worker does not reload config values when the json file is changed.
The often cited
reloadOnChange: true
option when adding a json file for configuration, as seen below, does not seem to be respected.This prevents IOptionsMonitor/IOptionsSnapshot from returning up-to-date values for json provided configuration.
I looked through the docs to determine if this is an intended/known limitation for the isolated worker process, but never found anything explicit.
Steps to reproduce
See this repo to reproduce the the current behavior in an azure function app alongside the expected behavior in a web api.