Closed josere closed 3 years ago
Well, i made it work with this changes:
"Options:Name": "Value1"
var host = Host.CreateDefaultBuilder(args) .ConfigureFunctionsWorker((_, b) => { b.UseFunctionExecutionMiddleware(); }) .ConfigureServices((c, s) => {
3. Bind like this:
s.AddOptions<MyOptions>()
.Bind(c.Configuration.GetSection("Options"));
It used to work that I created a MyOptions csharp object and then call during configuration:
my function then can have a (IOptions config) parameter, with the Value set to a object populated with values from the settings where I can set
"Options__Name": "Value1"
.so config.Value.Name was set to "Value1". This doesn't seem to work anymore. Basically, configuration.GetSection("Options").Exists() returns false.
I can see that
Environment.GetEnvironmentVariable("Options__Name")
has the "Value1" value.It would be nice if the sample app have a sample of user config values.
Thanks, Jose.