Glossary
Connection string
The setting that tells an Application Insights SDK or OpenTelemetry distro where to send telemetry, as semicolon-separated key=value pairs holding the instrumentation key and the regional endpoints.
A connection string holds up to 4,096 characters of key=value pairs separated by semicolons. InstrumentationKey is required; IngestionEndpoint, LiveEndpoint, ProfilerEndpoint, SnapshotEndpoint and EndpointSuffix are optional, and ApplicationId is added for you. Copy it from the Overview section of the Application Insights resource rather than assembling it by hand, because the endpoints point the SDK at the resource’s region:
InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://southcentralus.in.applicationinsights.azure.com/
Microsoft recommends the APPLICATIONINSIGHTS_CONNECTION_STRING environment variable in production for every language, and setting the value in code only for local development and tests. In classic ASP.NET Core, a connection string set in code wins over that environment variable, which wins over other options. The Java agent can also read it from applicationinsights.json.
The .NET SDK 3.x requires a connection string and can fail at startup without one; for tests, a string with the all-zeros key shown above works. A connection string replaced the bare instrumentation key, whose ingestion path Microsoft stopped supporting on March 31, 2025.