netdaemon
netdaemon copied to clipboard
remove dependecy on appsettings.json and make it optional
Describe your feature
Example code
// Insert any example code here that will help describe your requests
Additional information
Added by Discord user helto
On a similar note putting in documentation for using dotnet user-secrets (https://docs.microsoft.com/en-us/aspnet/core/security/app-secrets?view=aspnetcore-6.0&tabs=linux) for the host info so it isnt in source control would be nice. It works out of the box (assuming you remove the corresponding config from appsettings.json so they dont get overridden) as the template uses Host.CreateDefaultBuilder() as its base.
Just wondering what the motivation for this suggestion is. We ship with a default appsettings that just works(tm) and if you start to do anything remotely complex (custom logging, mqtt etc.) then you need to reinstate it.
Looking at these lines where we add the appsettings.json file they are redundant when using Host.CreateDefaultBuilder(args) and could be removed. However if we are want to continue explicitly adding them we are already specifying that apssetings.json and appsettings.{Environment}.json are optional with the bool true after the file name so I think we can close this?
I don't have appsettings.json in my container, it uses the settings from environment and that works just fine.
Closing this issue