Connection strings specify to which Application Insights resource your instrumented application should send telemetry data. A connection string is composed of multiple settings, each represented as a key-value pair and separated by semicolons. This consolidated configuration method simplifies the setup process by eliminating the need for multiple proxy settings.
Important
The connection string contains an ikey and an ApplicationId.
The ikey is a unique identifier used by the ingestion service to associate telemetry to a specific Application Insights resource. Ikey unique identifiers aren't security tokens or security keys, and aren't considered secrets. Connection strings are enhanced by adding the ApplicationId value. This update is a new feature that supports automatic instrumentation for scenarios utilizing the Open Telemetry SDK. If you want to protect your Application Insights resource from misuse, the ingestion endpoint provides authenticated telemetry ingestion options based on Microsoft Entra ID.
Note
On March 31, 2025, support for instrumentation key ingestion will end. Instrumentation key ingestion will continue to work, but we'll no longer provide updates or support for the feature. Transition to connection strings to take advantage of new capabilities.
Connection string capabilitiesYour connection string appears in the Overview section of your Application Insights resource.
SchemaSchema elements are explained in the following sections.
Max lengthThe connection has a maximum supported length of 4,096 characters.
Key-value pairsA connection string consists of a list of settings represented as key-value pairs separated by a semicolon: key1=value1;key2=value2;key3=value3
Tip
Configurable key-value pairs are covered in this document. Some key-value pairs aren't configurable and are set automatically, such as ApplicationId
. These pairs can be safely ignored if they're observed in your environment.
InstrumentationKey
(for example, 00000000-0000-0000-0000-000000000000). InstrumentationKey
is a required field.
Authorization
(for example, ikey). This setting is optional because today we only support ikey authorization.
EndpointSuffix
(for example, applicationinsights.azure.cn). Setting the endpoint suffix tells the SDK which Azure cloud to connect to. The SDK assembles the rest of the endpoint for individual services.
Explicit endpoints. Any service can be explicitly overridden in the connection string:
IngestionEndpoint
(for example, https://dc.applicationinsights.azure.com
)LiveEndpoint
(for example, https://live.applicationinsights.azure.com
)ProfilerEndpoint
(for example, https://profiler.monitor.azure.com
)SnapshotEndpoint
(for example, https://snapshot.monitor.azure.com
)<prefix>.<suffix>
For more information, see Regions that require endpoint modification.
Valid prefixesdc
live
profiler
snapshot
Here are some examples of connection strings.
Connection string with an endpoint suffixInstrumentationKey=00000000-0000-0000-0000-000000000000;EndpointSuffix=ai.contoso.com;
In this example, the connection string specifies the endpoint suffix and the SDK constructs service endpoints:
https://dc.ai.contoso.com
https://live.ai.contoso.com
https://profiler.ai.contoso.com
https://snapshot.ai.contoso.com
InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://custom.com:111/;LiveEndpoint=https://custom.com:222/;ProfilerEndpoint=https://custom.com:333/;SnapshotEndpoint=https://custom.com:444/;
In this example, the connection string specifies explicit overrides for every service. The SDK uses the exact endpoints provided without modification:
https://custom.com:111/
https://custom.com:222/
https://custom.com:333/
https://custom.com:444/
InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://southcentralus.in.applicationinsights.azure.com/
In this example, the connection string specifies the South Central US region:
https://southcentralus.in.applicationinsights.azure.com/
To list available regions, run the following command in the Azure CLI:
az account list-locations -o table
All our OpenTelemetry offerings and the following SDK versions onwards support connection strings:
You can set a connection string in code, by using an environment variable, or a configuration file.
Environment variableConnection string: APPLICATIONINSIGHTS_CONNECTION_STRING
To review frequently asked questions (FAQ):
Get started at runtime with:
Get started at development time with:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4