Skip to content

Commit ca773d3

Browse files
authored
Load the host config we are writing (#5589)
1 parent d0410b6 commit ca773d3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/WebJobs.Script/Config/HostJsonFileConfigurationSource.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ private JObject LoadHostConfigurationFile()
142142
ScriptApplicationHostOptions options = _configurationSource.HostOptions;
143143
string hostFilePath = Path.Combine(options.ScriptPath, ScriptConstants.HostMetadataFileName);
144144
JObject hostConfigObject = LoadHostConfig(hostFilePath);
145-
InitializeHostConfig(hostFilePath, hostConfigObject);
145+
hostConfigObject = InitializeHostConfig(hostFilePath, hostConfigObject);
146146
string sanitizedJson = SanitizeHostJson(hostConfigObject);
147147

148148
_logger.HostConfigApplied();
@@ -155,7 +155,7 @@ private JObject LoadHostConfigurationFile()
155155
}
156156
}
157157

158-
private void InitializeHostConfig(string hostJsonPath, JObject hostConfigObject)
158+
private JObject InitializeHostConfig(string hostJsonPath, JObject hostConfigObject)
159159
{
160160
using (_metricsLogger.LatencyEvent(MetricEventNames.InitializeHostConfiguration))
161161
{
@@ -173,6 +173,7 @@ private void InitializeHostConfig(string hostJsonPath, JObject hostConfigObject)
173173
throw new HostConfigurationException($"The {ScriptConstants.HostMetadataFileName} file is missing the required 'version' property. See https://aka.ms/functions-hostjson for steps to migrate the configuration file.");
174174
}
175175
}
176+
return hostConfigObject;
176177
}
177178

178179
internal JObject LoadHostConfig(string configFilePath)

0 commit comments

Comments
 (0)