# WithAzureApplicationInsights

- Module: [Aspire.Hosting.Azure.AppService](/reference/api/go/aspire.hosting.azure.appservice.md)
- Version: `17.0.0`
- Kind: `method`
- Defined on: [`AzureAppServiceEnvironmentResource`](/reference/api/go/aspire.hosting.azure.appservice/azureappserviceenvironmentresource.md)
- Source: [GitHub](https://github.com/microsoft/aspire/tree/bcfa151cdca6d0a573f22d5d9c23f9c727cb3b2f)

Enables Azure Application Insights for the Azure App Service environment

## Definition

```go
func (AzureAppServiceEnvironmentResource) WithAzureApplicationInsights(options ...*WithAzureApplicationInsightsOptions) AzureAppServiceEnvironmentResource
```

## Parameters

- `options` (`...*WithAzureApplicationInsightsOptions`) -- optional settings, see [Options](#options)

## Options

Optional parameters are passed in a trailing `options ...*WithAzureApplicationInsightsOptions` argument.

- `ApplicationInsights` (`any`)

## Returns

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

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

## Applies to

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