Can we use environment variables (or even key vault, api management, ...) for saving the log level? If so, how? I can't seem to find it anywhere.
End goal is to be able to change it during runtime without redeploy or editing appsettings.json
.
If you are opened to use a different service, maybe Azure App Configuration.
Azure App Configuration provides a service to centrally manage application settings. Modern programs, especially programs running in a cloud, generally have many components that are distributed in nature. Spreading configuration settings across these components can lead to hard-to-troubleshoot errors during an application deployment. Use App Configuration to store all the settings for your application and secure their accesses in one place.
App Configuration makes it easier to implement the following scenarios:
- Centralized management and distribution of hierarchical configuration data for different environments and geographies
- Dynamic configuration changes without the need to redeploy or restart an application
- Control feature availability in real-time