# withAppInsights

- Module: [Aspire.Hosting.Foundry](/reference/api/typescript/aspire.hosting.foundry.md)
- Version: `13.4.0-preview.1.26281.18`
- Kind: `method`
- Source: [GitHub](https://github.com/microsoft/aspire)

Adds an Application Insights resource to the Microsoft Foundry project, overriding the default (which is to create a new Application Insights resource).

## Definition

```typescript
interface AzureCognitiveServicesProjectResource {
  // ... omitted for brevity
  withAppInsights(appInsights: AzureApplicationInsightsResource): AzureCognitiveServicesProjectResource
}
```

## Parameters

- `appInsights` (`AzureApplicationInsightsResource`)

## Returns

[AzureCognitiveServicesProjectResource](/reference/api/typescript/aspire.hosting.foundry/azurecognitiveservicesprojectresource.md) `builder`

## Applies to

- [AzureCognitiveServicesProjectResource](/reference/api/typescript/aspire.hosting.foundry/azurecognitiveservicesprojectresource.md)
