Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/WebJobs.Script/Environment/EnvironmentExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,15 @@ public static bool IsLogicApp(this IEnvironment environment)
return !string.IsNullOrEmpty(appKind) && appKind.Contains(ScriptConstants.WorkFlowAppKind);
}

/// <summary>
/// Gets if codeful mode is enabled for Logic App app kind.
/// </summary>
public static bool IsLogicAppCodefulModeEnabled(this IEnvironment environment)
{
bool.TryParse(environment.GetEnvironmentVariable(LogicAppCodefulModeEnabled), out bool logicAppCodefulModeEnabled);
Copy link
Preview

Copilot AI Sep 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the full qualified name EnvironmentSettingNames.LogicAppCodefulModeEnabled instead of the unqualified constant name to improve code clarity and follow C# best practices.

Copilot generated this review using guidance from repository custom instructions.

return logicAppCodefulModeEnabled;
}

/// <summary>
/// Gets if runtime environment needs multi language.
/// </summary>
Expand Down
4 changes: 3 additions & 1 deletion src/WebJobs.Script/Environment/EnvironmentSettingNames.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

namespace Microsoft.Azure.WebJobs.Script
Expand Down Expand Up @@ -155,6 +155,8 @@ public static class EnvironmentSettingNames

public const string AppKind = "APP_KIND";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove empty line 157 and add a comment for LA settings -

// Logic apps settings
public const string AppKind = "APP_KIND";
public const string LogicAppCodefulModeEnabled = "WORKFLOW_CODEFUL_ENABLED";


public const string LogicAppCodefulModeEnabled = "WORKFLOW_CODEFUL_ENABLED";

public const string DrainOnApplicationStopping = "FUNCTIONS_ENABLE_DRAIN_ON_APP_STOPPING";
}
}
4 changes: 2 additions & 2 deletions src/WebJobs.Script/Host/ScriptHost.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

using System;
Expand Down Expand Up @@ -803,7 +803,7 @@ internal async Task<Collection<FunctionDescriptor>> GetFunctionDescriptorsAsync(
Collection<FunctionDescriptor> functionDescriptors = new Collection<FunctionDescriptor>();
if (!cancellationToken.IsCancellationRequested)
{
bool throwOnWorkerRuntimeAndPayloadMetadataMismatch = true;
bool throwOnWorkerRuntimeAndPayloadMetadataMismatch = _environment.IsLogicApp() && _environment.IsLogicAppCodefulModeEnabled() ? false : true;
Copy link
Preview

Copilot AI Sep 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ternary operator ? false : true is unnecessarily verbose. This can be simplified to !(_environment.IsLogicApp() && _environment.IsLogicAppCodefulModeEnabled()) for better readability.

Suggested change
bool throwOnWorkerRuntimeAndPayloadMetadataMismatch = _environment.IsLogicApp() && _environment.IsLogicAppCodefulModeEnabled() ? false : true;
bool throwOnWorkerRuntimeAndPayloadMetadataMismatch = !(_environment.IsLogicApp() && _environment.IsLogicAppCodefulModeEnabled());

Copilot uses AI. Check for mistakes.

// 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())
{
Expand Down
3 changes: 2 additions & 1 deletion src/WebJobs.Script/Utility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1034,7 +1034,8 @@ public static void ValidateRetryOptions(RetryOptions
// WORKER_INDEXING_DISABLED contains the customers app name worker indexing is then disabled for that customer only
public static bool CanWorkerIndex(IEnumerable<RpcWorkerConfig> workerConfigs, IEnvironment environment, FunctionsHostingConfigOptions functionsHostingConfigOptions)
{
if (environment.IsLogicApp())
// NOTE(apseth): Enabling the worker indexing for Logic Apps with codeful mode enabled.
if (environment.IsLogicApp() && !environment.IsLogicAppCodefulModeEnabled())
{
return false;
}
Expand Down