diff --git a/release_notes.md b/release_notes.md index 685ff1008b..2cea97bfde 100644 --- a/release_notes.md +++ b/release_notes.md @@ -3,15 +3,4 @@ -- Improved memory metrics reporting using CGroup data for Linux consumption (#10968) -- Memory allocation optimizations in `RpcWorkerConfigFactory.AddProviders` (#10959) -- Fixing GrpcWorkerChannel concurrency bug (#10998) -- Avoid circular dependency when resolving LinuxContainerLegionMetricsPublisher. (#10991) -- Add 'unix' to the list of runtimes kept when importing PowerShell worker for Linux builds -- Update PowerShell 7.4 worker to 4.0.4206 -- Update Python Worker Version to [4.37.0](https://github.com/Azure/azure-functions-python-worker/releases/tag/4.37.0) -- Add runtime and process metrics. (#11034) -- Add `win-arm64` and `linux-arm64` to the list of PowerShell runtimes; added filter for `osx` RIDs (includes `osx-x64` and `osx-arm64`) (#11013) -- Disable Diagnostic Events when Table Storage is not accessible (#10996) -- Update flex metric publisher to publish every 30 seconds (regardless of actvity) (#11019) -- Add JitTrace Files for v4.1040 +- Fix Instance Manager for CV1 Migration (#11072) diff --git a/src/Directory.Version.props b/src/Directory.Version.props index 5eff91734f..4ada058891 100644 --- a/src/Directory.Version.props +++ b/src/Directory.Version.props @@ -1,6 +1,6 @@ - 4.1040.100 + 4.1040.200 true diff --git a/src/WebJobs.Script.WebHost/WebHostServiceCollectionExtensions.cs b/src/WebJobs.Script.WebHost/WebHostServiceCollectionExtensions.cs index 628f0cfa8f..0d5eb6d79e 100644 --- a/src/WebJobs.Script.WebHost/WebHostServiceCollectionExtensions.cs +++ b/src/WebJobs.Script.WebHost/WebHostServiceCollectionExtensions.cs @@ -145,7 +145,7 @@ public static void AddWebJobsScriptHost(this IServiceCollection services, IConfi services.AddTransient(); services.AddTransient(); - if (SystemEnvironment.Instance.IsFlexConsumptionSku()) + if (SystemEnvironment.Instance.IsLinuxConsumptionOnLegion() || SystemEnvironment.Instance.IsFlexConsumptionSku()) { services.AddSingleton(); } diff --git a/test/WebJobs.Script.Tests/Environment/EnvironmentTests.cs b/test/WebJobs.Script.Tests/Environment/EnvironmentTests.cs index 814ce23098..0d9c905adc 100644 --- a/test/WebJobs.Script.Tests/Environment/EnvironmentTests.cs +++ b/test/WebJobs.Script.Tests/Environment/EnvironmentTests.cs @@ -3,6 +3,7 @@ using System; using System.Runtime.InteropServices; +using System.Threading.Tasks; using Microsoft.WebJobs.Script.Tests; using Xunit; using static Microsoft.Azure.WebJobs.Script.EnvironmentSettingNames; @@ -244,6 +245,24 @@ public void Returns_IsLinuxConsumption(string websiteInstanceId, string containe Assert.False(isLinuxConsumptionOnAtlas ? isLinuxConsumptionOnLegion : isLinuxConsumptionOnAtlas); } + [Theory] + [InlineData(ScriptConstants.DynamicSku, "containerName", "", "", false)] + [InlineData(ScriptConstants.DynamicSku, "containerName", "podName", "", false)] + [InlineData(ScriptConstants.DynamicSku, "containerName", "podName", "legionServiceHost", true)] + [InlineData(ScriptConstants.DynamicSku, "containerName", "", "legionServiceHost", true)] + public void Returns_AtlasOrLegionConsumption(string sku, string containerName, string podName, string legionServiceHost, bool legion) + { + var testEnvironment = new TestEnvironment(); + testEnvironment.SetEnvironmentVariable(EnvironmentSettingNames.AzureWebsiteInstanceId, string.Empty); + testEnvironment.SetEnvironmentVariable(EnvironmentSettingNames.AzureWebsiteSku, sku); + testEnvironment.SetEnvironmentVariable(EnvironmentSettingNames.ContainerName, containerName); + testEnvironment.SetEnvironmentVariable(EnvironmentSettingNames.PodName, podName); + testEnvironment.SetEnvironmentVariable(EnvironmentSettingNames.LegionServiceHost, legionServiceHost); + + Assert.Equal(legion, testEnvironment.IsLinuxConsumptionOnLegion()); + Assert.Equal(!legion, testEnvironment.IsLinuxConsumptionOnAtlas()); + } + [Theory] [InlineData(ScriptConstants.ElasticPremiumSku, true)] [InlineData("test", false)]