# DurableTaskSchedulerResource

- Module: [Aspire.Hosting.Azure.Functions](/reference/api/typescript/aspire.hosting.azure.functions.md)
- Version: `13.4.0`
- Kind: `handle`
- Source: [GitHub](https://github.com/microsoft/aspire)

## Definition

```typescript
interface DurableTaskSchedulerResource
  extends IExpressionValue,
    IManifestExpressionProvider,
    IResource,
    IResourceWithConnectionString,
    IResourceWithEndpoints,
    IValueProvider,
    IValueWithReferences {
  addTaskHub(name: string): DurableTaskHubResource;
  runAsEmulator(configureContainer?: (obj: DurableTaskSchedulerEmulatorResource) => Promise<void>): DurableTaskSchedulerResource;
  runAsExisting(connectionString: ParameterResource): DurableTaskSchedulerResource;
}
```

## Methods

- [addTaskHub](/reference/api/typescript/aspire.hosting.azure.functions/durabletaskschedulerresource/addtaskhub.md) -- `method` -- Adds a Durable Task hub resource associated with the specified scheduler.
    ```typescript
  addTaskHub(name: string): DurableTaskHubResource
  ```
- [runAsEmulator](/reference/api/typescript/aspire.hosting.azure.functions/durabletaskschedulerresource/runasemulator.md) -- `method` -- Configures the Durable Task scheduler to run using the local emulator (only in non-publish modes).
    ```typescript
  runAsEmulator(configureContainer?: (obj: DurableTaskSchedulerEmulatorResource) => Promise<void>): DurableTaskSchedulerResource
  ```
- [runAsExisting](/reference/api/typescript/aspire.hosting.azure.functions/durabletaskschedulerresource/runasexisting.md) -- `method` -- Configures the Durable Task scheduler to use an existing scheduler instance from a connection string or parameter resource.
    ```typescript
  runAsExisting(connectionString: ParameterResource): DurableTaskSchedulerResource
  ```
