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 @@ -425,6 +425,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);
return logicAppCodefulModeEnabled;
}

/// <summary>
/// Gets if runtime environment needs multi language.
/// </summary>
Expand Down
2 changes: 2 additions & 0 deletions src/WebJobs.Script/Environment/EnvironmentSettingNames.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ public static class EnvironmentSettingNames

public const string AppKind = "APP_KIND";

public const string LogicAppCodefulModeEnabled = "WORKFLOW_CODEFUL_ENABLED";

public const string DrainOnApplicationStopping = "FUNCTIONS_ENABLE_DRAIN_ON_APP_STOPPING";
}
}
2 changes: 1 addition & 1 deletion src/WebJobs.Script/Host/ScriptHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,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 can be simplified. Since the condition already evaluates to a boolean, you can negate it directly: bool throwOnWorkerRuntimeAndPayloadMetadataMismatch = !(_environment.IsLogicApp() && _environment.IsLogicAppCodefulModeEnabled());

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))
{
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 @@ -1028,7 +1028,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
Loading