From 7eb134904a060eab8f5206d39f3817751b55a84b Mon Sep 17 00:00:00 2001 From: Ramon Smits Date: Mon, 9 Oct 2023 17:55:45 +0200 Subject: [PATCH] Also add support for envvar expanding of config file settings in audit instance --- .../Infrastructure/Settings/ConfigFileSettingsReader.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ServiceControl.Audit/Infrastructure/Settings/ConfigFileSettingsReader.cs b/src/ServiceControl.Audit/Infrastructure/Settings/ConfigFileSettingsReader.cs index 8a87004149..3e4bf6ecc7 100644 --- a/src/ServiceControl.Audit/Infrastructure/Settings/ConfigFileSettingsReader.cs +++ b/src/ServiceControl.Audit/Infrastructure/Settings/ConfigFileSettingsReader.cs @@ -24,9 +24,11 @@ public static bool TryRead(string root, string name, out T value) { var fullKey = $"{root}/{name}"; - if (ConfigurationManager.AppSettings[fullKey] != null) + var appSettingValue = ConfigurationManager.AppSettings[fullKey]; + if (appSettingValue != null) { - value = (T)Convert.ChangeType(ConfigurationManager.AppSettings[fullKey], typeof(T)); + appSettingValue = Environment.ExpandEnvironmentVariables(appSettingValue); + value = (T)Convert.ChangeType(appSettingValue, typeof(T)); return true; }