---
title: Add Application Insights in .NET
slug: configured-commerce/docs/add-appinsights-in-net
docTags: 
createdAt: 2026-08-13T10:46:32.000Z
---

## Prerequisites

- Optimizely Configured Commerce 5.2.2411 or later.
- Application Insights connection string

:::hint{type="info"}
**📘 Note**
Optimizely does not provide the Application Insights connection string. You or your partner must provide them.
:::

## Implement Application Insights

You can add the Application Insights connection string at **System > Developer > Application Insights Connection String**.

![](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/gZZjQ5g1u-9FC7fHmTfRW_d1c93c26ee3646ad12d3b83080585067021ac7c30d07b4298321326a098d5087-application-insights-connection-string.png)

You must restart the site when adding or changing the connection string.

:::hint{type="info"}
**📘 Note**
This setting is only available for ISC\_System and ISC\_Implementer user roles.
:::

## Customize Application Insights

Below are some ways to customize Application Insights. See [Microsoft's documentation](https://learn.microsoft.com/en-us/azure/azure-monitor/app/app-insights-overview) for what else you can do.

Although they offer many supported languages, Configured Commerce uses [ASP.NET](https://learn.microsoft.com/en-us/azure/azure-monitor/app/asp-net?tabs=net%2Cserver%2Cportal%2Ccsharp) in its base.

### Use Extensions to customize data

Your `Extensions.dll` can define any number of `ITelemetryInitializer` classes. You can use them to customize data such as `RoleName` and `RoleInstance`.

```csharp
public class CustomTelemetryInitializer : ITelemetryInitializer
{
    public void Initialize(ITelemetry telemetry)
    {
        telemetry.Context.Cloud.RoleName = "CustomRole";
        telemetry.Context.Cloud.RoleInstance = "CustomInstance";
    }
} 
```

See [Enable a framework extension for Application Insights JavaScript SDK](https://learn.microsoft.com/en-us/azure/azure-monitor/app/javascript-framework-extensions?tabs=react). For Spire, partners can implement as much of this as needed.

Ensure to match environment keys with C# code. This can be swapped with the JS build constant `IS_PRODUCTION` to change keys. See [Microsoft's applicationinsights-react-js repository](https://github.com/microsoft/applicationinsights-react-js/blob/main/sample/applicationinsights-react-sample/src/ApplicationInsightsService.tsx) for information.

### Configure availability

You can configure availability in Application Insights. See [Microsoft's documentation on availability tests](https://learn.microsoft.com/en-us/azure/azure-monitor/app/availability?tabs=standard).
