Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
8 changes: 4 additions & 4 deletions src/WebJobs.Script.WebHost/Controllers/HostController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -317,17 +317,17 @@ public async Task<IActionResult> GetScaleStatus([FromBody] ScaleStatusContext co
}

// TEMP: Once https://github.com/Azure/azure-functions-host/issues/5161 is fixed, we should take
// FunctionsScaleManager as a parameter.
if (Utility.TryGetHostService(scriptHostManager, out FunctionsScaleManager scaleManager))
// IScaleStatusProvider as a parameter.
if (Utility.TryGetHostService(scriptHostManager, out IScaleStatusProvider scaleStatusProvider))
{
var scaleStatus = await scaleManager.GetScaleStatusAsync(context);
var scaleStatus = await scaleStatusProvider.GetScaleStatusAsync(context);
return new ObjectResult(scaleStatus);
}
else
{
// This case should never happen. Because this action is marked RequiresRunningHost,
// it's only invoked when the host is running, and if it's running, we'll have access
// to the FunctionsScaleManager.
// to the IScaleStatusProvider.
return StatusCode(StatusCodes.Status503ServiceUnavailable);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ private static ExpectedDependencyBuilder CreateExpectedDependencies()
.Expect<WorkerConsoleLogService>()
.Expect<FunctionInvocationDispatcherShutdownManager>()
.Expect<WorkerConcurrencyManager>()
.Optional<FunctionsScaleMonitorService>()
.Optional<FuncAppFileProvisioningService>() // Used by powershell.
.Optional<JobHostService>() // Missing when host is offline.
.Optional<FunctionsSyncService>() // Conditionally registered.
.OptionalExternal("Microsoft.AspNetCore.DataProtection.Internal.DataProtectionHostedService", "Microsoft.AspNetCore.DataProtection", "adb9793829ddae60") // Popularly-registered by DataProtection.
.OptionalExternal("Microsoft.Extensions.Diagnostics.HealthChecks.HealthCheckPublisherHostedService", "Microsoft.Extensions.Diagnostics.HealthChecks", "adb9793829ddae60") // Popularly-registered by Health Check Monitor.
.OptionalExternal("OpenTelemetry.Extensions.Hosting.Implementation.TelemetryHostedService", "OpenTelemetry.Extensions.Hosting", "7bd6737fe5b67e3c") // Enable OpenTelemetry.Net instrumentation library
.OptionalExternal("Microsoft.Azure.WebJobs.Hosting.PrimaryHostCoordinator", "Microsoft.Azure.WebJobs.Host", "31bf3856ad364e35")
.OptionalExternal("Microsoft.Azure.WebJobs.Host.Scale.ConcurrencyManagerService", "Microsoft.Azure.WebJobs.Host", "31bf3856ad364e35");
.OptionalExternal("Microsoft.Azure.WebJobs.Host.Scale.ConcurrencyManagerService", "Microsoft.Azure.WebJobs.Host", "31bf3856ad364e35")
.OptionalExternal("Microsoft.Azure.WebJobs.Host.Scale.ScaleMonitorService", "Microsoft.Azure.WebJobs.Host", "31bf3856ad364e35");

expected.ExpectSubcollection<ILoggerProvider>()
.Expect<FunctionFileLoggerProvider>()
Expand Down
2 changes: 1 addition & 1 deletion src/WebJobs.Script.WebHost/WebJobs.Script.WebHost.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
<PackageReference Include="Microsoft.Azure.Cosmos.Table" Version="1.0.8" />
<PackageReference Include="Microsoft.Azure.Storage.File" Version="11.1.7" />

<PackageReference Include="Microsoft.Azure.WebJobs" Version="3.0.36" />
<PackageReference Include="Microsoft.Azure.WebJobs" Version="3.0.37-11123" />
<PackageReference Include="Microsoft.Azure.WebJobs.Host.Storage" Version="5.0.0-beta.2-11957" />
<PackageReference Include="Microsoft.Azure.WebSites.DataProtection" Version="2.1.91-alpha" />
<PackageReference Include="Microsoft.IdentityModel.Tokens" Version="$(IdentityDependencyVersion)" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public static IHostBuilder AddWebScriptHost(this IHostBuilder builder, IServiceP
// EasyAuth must go after CORS, as CORS preflight requests can happen before authentication
services.TryAddEnumerable(ServiceDescriptor.Singleton<IJobHostHttpMiddleware, JobHostEasyAuthMiddleware>());
}
services.TryAddSingleton<IScaleMetricsRepository, TableStorageScaleMetricsRepository>();
services.AddSingleton<IScaleMetricsRepository, TableStorageScaleMetricsRepository>();
Comment thread
alrod marked this conversation as resolved.

services.TryAddEnumerable(ServiceDescriptor.Singleton<IConcurrencyThrottleProvider, WorkerChannelThrottleProvider>());

Expand Down
94 changes: 0 additions & 94 deletions src/WebJobs.Script/Config/ScaleOptions.cs

This file was deleted.

25 changes: 25 additions & 0 deletions src/WebJobs.Script/Config/ScaleOptionsSetup.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

using Microsoft.Azure.WebJobs.Host.Scale;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Options;

namespace Microsoft.Azure.WebJobs.Script.Configuration
{
internal class ScaleOptionsSetup : IConfigureOptions<ScaleOptions>
{
private readonly IEnvironment _environment;

public ScaleOptionsSetup(IEnvironment environment)
{
_environment = environment;
}

public void Configure(ScaleOptions options)
{
options.IsRuntimeScalingEnabled = _environment.IsRuntimeScaleMonitoringEnabled();
options.IsTargetScalingEnabled = _environment.IsTargetBasedScalingEnabled();
}
}
}
Loading