From 1787dd60bc3c69baf3d0dadb3ffabe77236e0d84 Mon Sep 17 00:00:00 2001 From: Pravakar Garnayak Date: Wed, 19 Nov 2025 10:00:48 -0800 Subject: [PATCH 1/2] Do Not Modify Function Language for dotnet-isolated worker runtime in workflowApp --- src/WebJobs.Script/Host/ScriptHost.cs | 10 ++++++++-- .../WebHostEndToEnd/MultiLanguageEndToEndTests.cs | 9 ++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/WebJobs.Script/Host/ScriptHost.cs b/src/WebJobs.Script/Host/ScriptHost.cs index 39ca8365a6..6c608066e1 100644 --- a/src/WebJobs.Script/Host/ScriptHost.cs +++ b/src/WebJobs.Script/Host/ScriptHost.cs @@ -799,7 +799,7 @@ internal async Task> GetFunctionDescriptorsAsync( bool payloadMatchesWorkerRuntime = ValidateAndLogRuntimeMismatch(functions, workerRuntime, _hostingConfigOptions, _logger); if (!payloadMatchesWorkerRuntime) { - UpdateFunctionMetadataLanguageForDotnetAssembly(functions, workerRuntime); + UpdateFunctionMetadataLanguageForDotnetAssembly(functions, workerRuntime, _environment.IsLogicApp()); throwOnWorkerRuntimeAndPayloadMetadataMismatch = false; // we do not want to throw an exception in this case } } @@ -860,8 +860,14 @@ internal async Task> GetFunctionDescriptorsAsync( return functionDescriptors; } - private static void UpdateFunctionMetadataLanguageForDotnetAssembly(IEnumerable functions, string workerRuntime) + private static void UpdateFunctionMetadataLanguageForDotnetAssembly(IEnumerable functions, string workerRuntime, bool isLogicApp) { + if (isLogicApp) + { + // For Logic Apps, we want to keep the language as DotNetAssembly to avoid breaking changes. + return; + } + foreach (var function in functions) { if (function.Language == DotNetScriptTypes.DotNetAssembly) diff --git a/test/WebJobs.Script.Tests.Integration/WebHostEndToEnd/MultiLanguageEndToEndTests.cs b/test/WebJobs.Script.Tests.Integration/WebHostEndToEnd/MultiLanguageEndToEndTests.cs index ee639a7d98..89a43dc926 100644 --- a/test/WebJobs.Script.Tests.Integration/WebHostEndToEnd/MultiLanguageEndToEndTests.cs +++ b/test/WebJobs.Script.Tests.Integration/WebHostEndToEnd/MultiLanguageEndToEndTests.cs @@ -123,14 +123,17 @@ public async Task CodelessFunction_CanUse_SingleJavaLanguageProviders() /// Runs tests with Node language provider function. /// [Theory] - [InlineData(true)] - [InlineData(false)] - public async Task CodelessFunction_CanUse_SingleJavascriptLanguageProviders(bool enableDynamicWorkerResolution) + [InlineData(true, "dotnet")] + [InlineData(false, "dotnet")] + [InlineData(true, "dotnet-isolated")] + [InlineData(false, "dotnet-isolated")] + public async Task CodelessFunction_CanUse_SingleJavascriptLanguageProviders(bool enableDynamicWorkerResolution, string functionWorkerRuntime) { var sourceFunctionApp = Path.Combine(Environment.CurrentDirectory, "TestScripts", "NoFunction"); var settings = new Dictionary() { [EnvironmentSettingNames.AppKind] = "workflowApp", + [EnvironmentSettingNames.FunctionWorkerRuntime] = functionWorkerRuntime, }; var testEnvironment = new TestEnvironment(settings); From ae41f5d5cb2256e17ae14862acfb58d0ea3add0c Mon Sep 17 00:00:00 2001 From: Pravakar Garnayak Date: Wed, 3 Dec 2025 19:02:02 -0800 Subject: [PATCH 2/2] Disabled verification of runtime language mismatch --- src/WebJobs.Script/Host/ScriptHost.cs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/WebJobs.Script/Host/ScriptHost.cs b/src/WebJobs.Script/Host/ScriptHost.cs index 6c608066e1..a7710b08e3 100644 --- a/src/WebJobs.Script/Host/ScriptHost.cs +++ b/src/WebJobs.Script/Host/ScriptHost.cs @@ -791,15 +791,15 @@ internal async Task> GetFunctionDescriptorsAsync( Collection functionDescriptors = new Collection(); if (!cancellationToken.IsCancellationRequested) { - bool throwOnWorkerRuntimeAndPayloadMetadataMismatch = !(_environment.IsLogicApp() && _environment.IsLogicAppCodefulModeEnabled()); + bool throwOnWorkerRuntimeAndPayloadMetadataMismatch = !_environment.IsLogicApp(); // this dotnet isolated specific logic is temporary to ensure in-proc payload compatibility with "dotnet-isolated" as the FUNCTIONS_WORKER_RUNTIME value. - if (string.Equals(workerRuntime, RpcWorkerConstants.DotNetIsolatedLanguageWorkerName, StringComparison.OrdinalIgnoreCase) && !_environment.IsPlaceholderModeEnabled()) + if (!_environment.IsLogicApp() && string.Equals(workerRuntime, RpcWorkerConstants.DotNetIsolatedLanguageWorkerName, StringComparison.OrdinalIgnoreCase) && !_environment.IsPlaceholderModeEnabled()) { bool payloadMatchesWorkerRuntime = ValidateAndLogRuntimeMismatch(functions, workerRuntime, _hostingConfigOptions, _logger); if (!payloadMatchesWorkerRuntime) { - UpdateFunctionMetadataLanguageForDotnetAssembly(functions, workerRuntime, _environment.IsLogicApp()); + UpdateFunctionMetadataLanguageForDotnetAssembly(functions, workerRuntime); throwOnWorkerRuntimeAndPayloadMetadataMismatch = false; // we do not want to throw an exception in this case } } @@ -860,14 +860,8 @@ internal async Task> GetFunctionDescriptorsAsync( return functionDescriptors; } - private static void UpdateFunctionMetadataLanguageForDotnetAssembly(IEnumerable functions, string workerRuntime, bool isLogicApp) + private static void UpdateFunctionMetadataLanguageForDotnetAssembly(IEnumerable functions, string workerRuntime) { - if (isLogicApp) - { - // For Logic Apps, we want to keep the language as DotNetAssembly to avoid breaking changes. - return; - } - foreach (var function in functions) { if (function.Language == DotNetScriptTypes.DotNetAssembly)