Can we build the connection string if Instrumentation Key is available?

Anonymous
2023-03-06T22:41:35.1033333+00:00

We are migrating app insights 2.x to 3.4 version. In our customer environment they do have only Instrumentation Key set up. Can we build the connection string only using Instrumentation Key? without changing anything in the customer's environment?

Aren't IngestionEndpoint and LiveEndpoint optional?

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,645 questions
0 comments No comments
{count} votes

Accepted answer
  1. Marilee Turscak-MSFT 37,206 Reputation points Microsoft Employee Moderator
    2023-03-10T19:44:51.12+00:00

    Hi @Anonymous

    You can use the instrumentation key but it is not recommended since it is deprecated and has limitations. It is recommended to use the APPLICATIONINSIGHTS_CONNECTION_STRING since support for APPINSIGHTS_INSTRUMENTATIONKEY is ending. According to the documentation:

    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.

    So if you use APPINSIGHTS_INSTRUMENTATIONKEY you should migrate to APPLICATIONINSIGHTS_CONNECTION_STRING.

    Also, when you use the connection string, you can specify custom endpoints, which is not possible when you just specify the instrumentation key. If you only specify the instrumentation key, the SDK will connect to default global ingestion endpoints.

    Let me know if this helps and if you have further questions.

    See related:

    Troubleshoot missing application telemetry in Azure Monitor Application Insights

    How to pass connection string to Application Insights?

    Why do I need both APPINSIGHTS_INSTRUMENTATIONKEY and APPLICATIONINSIGHTS_CONNECTION_STRING in my Azure Function configuration?

    -

    *
    If the information helped you, please Accept the answer. This will help us as well as others in the community who might be researching similar questions.*


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.