diff --git a/Kudu.Core/Functions/KedaFunctionTriggerProvider.cs b/Kudu.Core/Functions/KedaFunctionTriggerProvider.cs index 9c8a24c2..c94899b6 100644 --- a/Kudu.Core/Functions/KedaFunctionTriggerProvider.cs +++ b/Kudu.Core/Functions/KedaFunctionTriggerProvider.cs @@ -316,7 +316,7 @@ internal static bool TryGetWorkflowKedaTrigger(string hostJsonText, string appNa // NOTE(haassyad): We only have one queue partition in single tenant. ["queueName"] = StringHelper.GetWorkflowQueueNameInternal(queuePrefix, 1), ["queueLength"] = queueLength, - ["connectionStringFromEnv"] = "AzureWebJobsStorage", + ["connectionFromEnv"] = "AzureWebJobsStorage", } }; diff --git a/Kudu.Core/K8SE/K8SEDeploymentHelper.cs b/Kudu.Core/K8SE/K8SEDeploymentHelper.cs index 81434611..15185b47 100644 --- a/Kudu.Core/K8SE/K8SEDeploymentHelper.cs +++ b/Kudu.Core/K8SE/K8SEDeploymentHelper.cs @@ -171,7 +171,7 @@ public static void UpdateContextWithAppSettings(HttpContext context) var key = setting.Key.Substring(appSettingsPrefix.Length); appSettings[key] = setting.Value; } - context.Items.Add("appSettings", appSettings); + context.Items.TryAdd("appSettings", appSettings); } private static string GetFunctionAppPatchJson(IEnumerable functionTriggers, BuildMetadata buildMetadata) diff --git a/Kudu.Services.Web/KubeMiddleware.cs b/Kudu.Services.Web/KubeMiddleware.cs index 3a1fc537..106a6a26 100644 --- a/Kudu.Services.Web/KubeMiddleware.cs +++ b/Kudu.Services.Web/KubeMiddleware.cs @@ -64,10 +64,10 @@ public async Task Invoke(HttpContext context, IEnvironment environment, IServerC } // Cache the App Environment for this request - context.Items.Add("environment", GetEnvironment(homeDir, appName, null, null, appNamenamespace, appType)); + context.Items.TryAdd("environment", GetEnvironment(homeDir, appName, null, null, appNamenamespace, appType)); // Cache the appName for this request - context.Items.Add("appName", appName); + context.Items.TryAdd("appName", appName); // Add All AppSettings to the context. K8SEDeploymentHelper.UpdateContextWithAppSettings(context); @@ -75,7 +75,7 @@ public async Task Invoke(HttpContext context, IEnvironment environment, IServerC // Cache the appNamenamespace for this request if it's not empty or null if (!string.IsNullOrEmpty(appNamenamespace)) { - context.Items.Add("appNamespace", appNamenamespace); + context.Items.TryAdd("appNamespace", appNamenamespace); } string[] pathParts = context.Request.Path.ToString().Split("/"); diff --git a/Kudu.Tests/Core/Function/KedaFunctionTriggersProviderTests.cs b/Kudu.Tests/Core/Function/KedaFunctionTriggersProviderTests.cs index b932263a..8a904404 100644 --- a/Kudu.Tests/Core/Function/KedaFunctionTriggersProviderTests.cs +++ b/Kudu.Tests/Core/Function/KedaFunctionTriggersProviderTests.cs @@ -82,7 +82,7 @@ public void WorkflowApp( string expectedQueueName, string expectedQueueLength, s var actualQueueLength = Assert.Contains("queueLength", queueTrigger.Metadata); Assert.Equal(actualQueueLength, expectedQueueLength); - string connectionStringFromEnv = Assert.Contains("connectionStringFromEnv", queueTrigger.Metadata); + string connectionStringFromEnv = Assert.Contains("connectionFromEnv", queueTrigger.Metadata); Assert.Equal("AzureWebJobsStorage", connectionStringFromEnv); } finally