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?
-
*
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.*