Skip to content

Commit

Permalink
Logic app scaler bugfix and zipdeploy k8se deploy try add instead of …
Browse files Browse the repository at this point in the history
…add (#205)

* Logic app scaler bugfix and zipdeploy k8se deploy try add instead of add

* Update workflowapp test

Co-authored-by: Hamza Assyad <haassyad@microsoft.com>
  • Loading branch information
Hamza Assyad and Hamza Assyad authored May 13, 2021
1 parent 17ce521 commit a17a854
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Kudu.Core/Functions/KedaFunctionTriggerProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}
};

Expand Down
2 changes: 1 addition & 1 deletion Kudu.Core/K8SE/K8SEDeploymentHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<ScaleTrigger> functionTriggers, BuildMetadata buildMetadata)
Expand Down
6 changes: 3 additions & 3 deletions Kudu.Services.Web/KubeMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,18 @@ 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);

// 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("/");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a17a854

Please sign in to comment.