diff --git a/src/WebJobs.Script/Workers/Rpc/RpcWorkerDescription.cs b/src/WebJobs.Script/Workers/Rpc/RpcWorkerDescription.cs index 570497343b..a43a5f1c76 100644 --- a/src/WebJobs.Script/Workers/Rpc/RpcWorkerDescription.cs +++ b/src/WebJobs.Script/Workers/Rpc/RpcWorkerDescription.cs @@ -53,6 +53,12 @@ public class RpcWorkerDescription : WorkerDescription [JsonProperty(PropertyName = "supportedRuntimeVersions")] public List SupportedRuntimeVersions { get; set; } + /// + /// Gets the minimum supported versions for this runtime. + /// + [JsonProperty(PropertyName = "minimumSupportedRuntimeVersion")] + public string MinimumSupportedRuntimeVersion { get; } + /// /// Gets or sets the regex used for sanitizing the runtime version string. /// @@ -202,6 +208,22 @@ internal void FormatWorkerPathIfNeeded(ISystemRuntimeInformation systemRuntimeIn DefaultRuntimeVersion = GetSanitizedRuntimeVersion(version); } + if (!string.IsNullOrEmpty(MinimumSupportedRuntimeVersion) && !string.IsNullOrEmpty(DefaultRuntimeVersion)) + { + if (Version.TryParse(DefaultRuntimeVersion, out var currentVersion) && + Version.TryParse(MinimumSupportedRuntimeVersion, out var minVersion)) + { + if (currentVersion < minVersion) + { + logger.LogWarning($"The configured runtime version '{DefaultRuntimeVersion}' for language '{Language}' is lower than the minimum supported version '{MinimumSupportedRuntimeVersion}'. Please update to a supported version. Visit aka.ms/supported-language-versions for more information."); + } + } + else + { + logger.LogWarning($"Could not parse runtime version(s): '{DefaultRuntimeVersion}' or '{MinimumSupportedRuntimeVersion}' for language '{Language}'."); + } + } + ValidateDefaultWorkerPathFormatters(systemRuntimeInformation); DefaultWorkerPath = DefaultWorkerPath.Replace(RpcWorkerConstants.OSPlaceholder, os.ToString())