Language

ServiceCollectionExtensions.ConfigureDurableAgents Method

Definition

Configures durable agents, automatically registering agent entities.

public static Microsoft.Extensions.DependencyInjection.IServiceCollection ConfigureDurableAgents(this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<Microsoft.Agents.AI.DurableTask.DurableAgentsOptions> configure, Action<Microsoft.DurableTask.Worker.IDurableTaskWorkerBuilder>? workerBuilder = default, Action<Microsoft.DurableTask.Client.IDurableTaskClientBuilder>? clientBuilder = default);
static member ConfigureDurableAgents : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<Microsoft.Agents.AI.DurableTask.DurableAgentsOptions> * Action<Microsoft.DurableTask.Worker.IDurableTaskWorkerBuilder> * Action<Microsoft.DurableTask.Client.IDurableTaskClientBuilder> -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function ConfigureDurableAgents (services As IServiceCollection, configure As Action(Of DurableAgentsOptions), Optional workerBuilder As Action(Of IDurableTaskWorkerBuilder) = Nothing, Optional clientBuilder As Action(Of IDurableTaskClientBuilder) = Nothing) As IServiceCollection

Parameters

services
IServiceCollection

The service collection.

configure
Action<DurableAgentsOptions>

A delegate to configure the durable agents.

workerBuilder
Action<IDurableTaskWorkerBuilder>

Optional delegate to configure the Durable Task worker.

clientBuilder
Action<IDurableTaskClientBuilder>

Optional delegate to configure the Durable Task client.

Returns

The service collection for chaining.

Remarks

This method provides an agent-focused configuration experience. If you need to configure both agents and workflows, consider using ConfigureDurableOptions(IServiceCollection, Action<DurableOptions>, Action<IDurableTaskWorkerBuilder>, Action<IDurableTaskClientBuilder>) instead.

Multiple calls to this method are supported and configurations are composed additively.

Applies to