# AddAzureFunctionsApp

- Module: [Aspire.Hosting.Azure.Functions](/reference/api/go/aspire.hosting.azure.functions.md)
- Version: `17.0.0`
- Kind: `method`
- Defined on: `DistributedApplicationBuilder`
- Source: [GitHub](https://github.com/microsoft/aspire/tree/2d325b13709752ba6d9a943635c5e2940a2530c0)

Adds an Azure Functions app from a source directory to the distributed application.

## Remarks

This overload is intended for Azure Functions apps that do not have a .NET project file, such as
TypeScript and JavaScript apps that run on the Node language worker. TypeScript apps are launched
through `npm run start` so the standard Core Tools generated `prestart` script can build
the app before the Functions host starts. The `start` script should resolve Azure Functions
Core Tools from the app's local npm dependencies, for example by depending on the
`azure-functions-core-tools` package.
By default, an implicit Azure Storage account is provisioned to be used as host storage for the Functions runtime.
Use `WithHostStorage`
to specify a custom Azure Storage resource as the host storage instead.
Add a TypeScript Azure Functions app to the app model.
```
#pragma warning disable ASPIREAZUREFUNCTIONS001
var builder = DistributedApplication.CreateBuilder(args);
builder.AddAzureFunctionsApp("funcapp", "../functions", AzureFunctionsLanguage.TypeScript);
builder.Build().Run();
#pragma warning restore ASPIREAZUREFUNCTIONS001
```

## Definition

```go
func (DistributedApplicationBuilder) AddAzureFunctionsApp(
    name string,
    appDirectory string,
    language AzureFunctionsLanguage,
) AzureFunctionsAppResource
```

## Parameters

- `name` (`string`) -- The name to be associated with the Azure Functions app. This name will be used for service discovery when referenced in a dependency.
- `appDirectory` (`string`) -- The path to the directory containing the Azure Functions app.
- `language` ([`AzureFunctionsLanguage`](/reference/api/go/aspire.hosting.azure.functions/azurefunctionslanguage.md)) -- The authoring language used by the Azure Functions app.

## Returns

[`AzureFunctionsAppResource`](/reference/api/go/aspire.hosting.azure.functions/azurefunctionsappresource.md) -- The resource builder.

Returns a handle; failures surface later via `Err()`.

## Applies to

- `DistributedApplicationBuilder`
