Skip to content
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
dfb12ca
as light scale
nytian Oct 29, 2025
0b2b2c6
update azurestorage and update sql
nytian Nov 3, 2025
335fff8
add azuremanaged
nytian Nov 5, 2025
2c51fb7
update
nytian Nov 5, 2025
a869d52
Merge branch 'dev' into nytian/sc-light-pkg
nytian Nov 5, 2025
9867a99
update
nytian Nov 5, 2025
af5545f
udpate options config to use metadata instead of di options
nytian Nov 5, 2025
f15aea3
Merge branch 'nytian/sc-light-pkg' of https://github.com/Azure/azure-…
nytian Nov 5, 2025
25e49ce
remove di options and use triggeremetada and update tests accordingly
nytian Nov 10, 2025
5973886
add scale test ci yml
nytian Nov 10, 2025
ffd44fd
Merge branch 'dev' into nytian/sc-light-pkg
nytian Nov 10, 2025
a2956b4
add nullable check to remove all build warnings
nytian Nov 10, 2025
0e950a0
udpate test
nytian Nov 10, 2025
a8e9bef
Merge branch 'nytian/sc-light-pkg' of https://github.com/Azure/azure-…
nytian Nov 10, 2025
9d8dd48
udpate yml
nytian Nov 10, 2025
9e52edf
udpate test
nytian Nov 10, 2025
8188cbe
udpate yml
nytian Nov 11, 2025
d9fbed3
udpate test
nytian Nov 11, 2025
9692154
update test
nytian Nov 11, 2025
2dd1e66
update hub name
nytian Nov 11, 2025
93c15b7
Merge branch 'dev' into nytian/sc-light-pkg
nytian Nov 13, 2025
f94ff06
update
nytian Nov 17, 2025
54ff4c2
Merge branch 'dev' into nytian/sc-light-pkg
nytian Nov 17, 2025
709487b
fix const string
nytian Nov 17, 2025
9ed6630
Merge branch 'nytian/sc-light-pkg' of https://github.com/Azure/azure-…
nytian Nov 17, 2025
fbb2acc
fix warning
nytian Nov 17, 2025
ebfefca
debug failed test
nytian Nov 17, 2025
ed56b50
update test
nytian Nov 17, 2025
09e3ece
update test
nytian Nov 17, 2025
ec4f7a1
update test
nytian Nov 17, 2025
80d13f4
fix
nytian Nov 18, 2025
bfb4207
update
nytian Nov 19, 2025
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
7 changes: 5 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
</PropertyGroup>
<!-- Product dependencies -->
<ItemGroup>
<PackageVersion Include="Azure.Identity" Version="1.12.1" />
<PackageVersion Include="Azure.Identity" Version="1.14.2" />
<PackageVersion Include="Grpc.Tools" Version="2.49.0" />
<PackageVersion Include="Grpc.Net.Client" Version="2.70.0" />
<PackageVersion Include="Grpc.Net.Client" Version="2.71.0" />
<PackageVersion Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.3.0" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.WebApiCompatShim" Version="2.2.0" />
<PackageVersion Include="Microsoft.Azure.DurableTask.ApplicationInsights" Version="0.8.0" />
Expand All @@ -31,6 +31,9 @@
<PackageVersion Include="Microsoft.DurableTask.Worker.Grpc" Version="1.16.1" />
<PackageVersion Include="Microsoft.DurableTask.Abstractions" Version="1.16.1" />
<PackageVersion Include="Microsoft.DurableTask.Analyzers" Version="0.1.0" />
<PackageVersion Include="Microsoft.DurableTask.AzureManagedBackend" Version="0.4.3-alpha" />
<PackageVersion Include="Microsoft.DurableTask.SqlServer" Version="1.5.2" />
<PackageVersion Include="Microsoft.Data.SqlClient" Version="5.1.2" />
<PackageVersion Include="Microsoft.Extensions.Azure" Version="1.7.0" />
<PackageVersion Include="Microsoft.Extensions.Caching.Memory" Version="6.0.3" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="6.0.0" />
Expand Down
7 changes: 7 additions & 0 deletions WebJobs.Extensions.DurableTask.sln
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DotNetIsolated", "test\Smok
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Worker.Extensions.DurableTask", "src\Worker.Extensions.DurableTask\Worker.Extensions.DurableTask.csproj", "{5F5FAF27-D6B8-4A60-ACF2-F63D13F89CA2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebJobs.Extensions.DurableTask.Scale", "src\WebJobs.Extensions.DurableTask.Scale\WebJobs.Extensions.DurableTask.Scale.csproj", "{A2E5E1B2-2B4B-4B6F-A0A7-6D7E0E68F1C9}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "pipelines", "pipelines", "{B7FBBE6E-9AC7-4CEB-9B80-6FD9AE74415A}"
ProjectSection(SolutionItems) = preProject
azure-pipelines.yml = azure-pipelines.yml
Expand Down Expand Up @@ -126,6 +128,10 @@ Global
{5F5FAF27-D6B8-4A60-ACF2-F63D13F89CA2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5F5FAF27-D6B8-4A60-ACF2-F63D13F89CA2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5F5FAF27-D6B8-4A60-ACF2-F63D13F89CA2}.Release|Any CPU.Build.0 = Release|Any CPU
{A2E5E1B2-2B4B-4B6F-A0A7-6D7E0E68F1C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A2E5E1B2-2B4B-4B6F-A0A7-6D7E0E68F1C9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A2E5E1B2-2B4B-4B6F-A0A7-6D7E0E68F1C9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A2E5E1B2-2B4B-4B6F-A0A7-6D7E0E68F1C9}.Release|Any CPU.Build.0 = Release|Any CPU
{FC8AD123-F949-4D21-B817-E5A4BBF7F69B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FC8AD123-F949-4D21-B817-E5A4BBF7F69B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FC8AD123-F949-4D21-B817-E5A4BBF7F69B}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -162,6 +168,7 @@ Global
{9B0F4A0A-1B18-4E98-850A-14A2F76F673D} = {A8CF6993-258A-484A-AF6D-6CC88D36AF93}
{FF6CD07A-A4BF-43C5-B14E-213328DEB835} = {9B0F4A0A-1B18-4E98-850A-14A2F76F673D}
{5F5FAF27-D6B8-4A60-ACF2-F63D13F89CA2} = {7EC858EE-3481-4A82-AED4-CB00C34F42D0}
{A2E5E1B2-2B4B-4B6F-A0A7-6D7E0E68F1C9} = {7EC858EE-3481-4A82-AED4-CB00C34F42D0}
{7387E723-E153-4B7A-B105-8C67BFBD48CF} = {78BCF152-C22C-408F-9FB1-0F8C99B154B5}
{FC8AD123-F949-4D21-B817-E5A4BBF7F69B} = {7387E723-E153-4B7A-B105-8C67BFBD48CF}
{76DEC17C-BF6A-498A-8E8A-7D6CB2E03284} = {78BCF152-C22C-408F-9FB1-0F8C99B154B5}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using System.Data.Common;

namespace Microsoft.Azure.WebJobs.Extensions.DurableTask.Scale.AzureManaged
{
/// <summary>
/// Connection string to conenct to AzureManaged backend service.
/// </summary>
public sealed class AzureManagedConnectionString
{
private readonly DbConnectionStringBuilder builder;

/// <summary>
/// Initializes a new instance of the <see cref="AzureManagedConnectionString"/> class.
/// </summary>
/// <param name="connectionString">A connection string for an Azure-managed durable task service.</param>
public AzureManagedConnectionString(string connectionString)
{
this.builder = new DbConnectionStringBuilder { ConnectionString = connectionString };
}

/// <summary>
/// Gets the authentication method specified in the connection string (if any).
/// </summary>
public string Authentication => this.GetValue("Authentication");

/// <summary>
/// Gets the managed identity or workload identity client ID specified in the connection string (if any).
/// </summary>
public string ClientId => this.GetValue("ClientID");

/// <summary>
/// Gets the endpoint specified in the connection string (if any).
/// </summary>
public string Endpoint => this.GetValue("Endpoint");

/// <summary>
/// Gets the task hub name specified in the connection string (if any).
/// </summary>
public string TaskHubName => this.GetValue("TaskHub");

private string GetValue(string name)
{
return this.builder.TryGetValue(name, out object value)
? value as string
: null;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using System;
using Microsoft.Azure.WebJobs.Host.Scale;
using Microsoft.DurableTask.AzureManagedBackend;
using Microsoft.Extensions.Logging;

namespace Microsoft.Azure.WebJobs.Extensions.DurableTask.Scale.AzureManaged
{
/// <summary>
/// The AzureManaged backend implementation of the scalability provider for Durable Functions.
/// </summary>
public class AzureManagedScalabilityProvider : ScalabilityProvider
{
private readonly AzureManagedOrchestrationService orchestrationService;
private readonly string connectionName;
private readonly ILogger logger;

/// <summary>
/// Initializes a new instance of the <see cref="AzureManagedScalabilityProvider"/> class.
/// </summary>
/// <param name="orchestrationService">
/// The <see cref="AzureManagedOrchestrationService"/> instance that provides access to backend service for scaling operations.
/// </param>
/// <param name="connectionName">
/// The logical name of the storage or service connection associated with this provider.
/// </param>
/// <param name="logger">
/// The <see cref="ILogger"/> instance used for logging provider activities and diagnostics.
/// </param>
/// <exception cref="ArgumentNullException">
/// Thrown if <paramref name="orchestrationService"/> is <see langword="null"/>.
/// </exception>
public AzureManagedScalabilityProvider(
AzureManagedOrchestrationService orchestrationService,
string connectionName,
ILogger logger)
: base("AzureManaged", connectionName)
{
this.orchestrationService = orchestrationService ?? throw new ArgumentNullException(nameof(orchestrationService));
this.connectionName = connectionName;
this.logger = logger;
}

/// <summary>
/// The app setting containing the Azure Managed connection string.
/// </summary>
public override string ConnectionName => this.connectionName;

/// <inheritdoc/>
/// This is not used.
public override bool TryGetScaleMonitor(
string functionId,
string functionName,
string hubName,
string connectionName,
out IScaleMonitor scaleMonitor)
{
// Azure Managed backend does not support the legacy scale monitor infrastructure.
// Return a dummy scale monitor to avoid exceptions.
scaleMonitor = new DummyScaleMonitor(functionId, hubName);
return true;
}

/// <inheritdoc/>
public override bool TryGetTargetScaler(
string functionId,
string functionName,
string hubName,
string connectionName,
out ITargetScaler targetScaler)
{
// Create a target scaler that uses the orchestration service's metrics endpoint.
// All target scalers share the same AzureManagedOrchestrationService in the same task hub.
targetScaler = new AzureManagedTargetScaler(this.orchestrationService, functionId);
return true;
}

private class DummyScaleMonitor : IScaleMonitor
{
private static readonly ScaleMetrics DummyScaleMetrics = new ScaleMetrics();
private static readonly ScaleStatus DummyScaleStatus = new ScaleStatus();

public DummyScaleMonitor(string functionId, string taskHub)
{
this.Descriptor = new ScaleMonitorDescriptor(
id: $"DurableTask.AzureManaged:{taskHub ?? "default"}",
functionId);
}

public ScaleMonitorDescriptor Descriptor { get; }

public System.Threading.Tasks.Task<ScaleMetrics> GetMetricsAsync() => System.Threading.Tasks.Task.FromResult(DummyScaleMetrics);

public ScaleStatus GetScaleStatus(ScaleStatusContext context) => DummyScaleStatus;
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using Microsoft.Extensions.DependencyInjection;

namespace Microsoft.Azure.WebJobs.Extensions.DurableTask.Scale.AzureManaged
{
/// <summary>
/// Extension methods for configuring the Azure Managed Durable Task backend.
/// </summary>
public static class AzureManagedScalabilityProviderExtensions
{
/// <summary>
/// Registers the Azure Managed Durable Task backend with the dependency injection container.
/// </summary>
public static void AddDurableTaskManagedBackend(this IServiceCollection services)
{
services.AddSingleton<IScalabilityProviderFactory, AzureManagedScalabilityProviderFactory>();
}
}
}
Loading
Loading