# AzureAppServiceEnvironmentResource.withAzureApplicationInsights

- Module: [Aspire.Hosting.Azure.AppService](/reference/api/typescript/aspire.hosting.azure.appservice.md)
- Defined on: [AzureAppServiceEnvironmentResource](/reference/api/typescript/aspire.hosting.azure.appservice/azureappserviceenvironmentresource.md)
- Version: `13.4.0`
- Kind: `method`

Enables Azure Application Insights for the Azure App Service environment

## Definition

```typescript
interface AzureAppServiceEnvironmentResource {
  // ... omitted for brevity
  withAzureApplicationInsights(applicationInsights?: AzureApplicationInsightsResource): AzureAppServiceEnvironmentResource;
}
```

## Signature

```typescript
withAzureApplicationInsights(applicationInsights?: AzureApplicationInsightsResource): AzureAppServiceEnvironmentResource
```

## Parameters

- `applicationInsights` (`AzureApplicationInsightsResource`) `optional`

## Returns

[AzureAppServiceEnvironmentResource](/reference/api/typescript/aspire.hosting.azure.appservice/azureappserviceenvironmentresource.md) `builder`

## Defined on

- [AzureAppServiceEnvironmentResource](/reference/api/typescript/aspire.hosting.azure.appservice/azureappserviceenvironmentresource.md) -- `handle`
