Application Insights overriding default endpoints

To send data from Application Insights to certain regions, you'll need to override the default endpoint addresses. Each SDK requires slightly different modifications, all of which are described in this article. These changes require adjusting the sample code and replacing the placeholder values for QuickPulse_Endpoint_Address, TelemetryChannel_Endpoint_Address, and Profile_Query_Endpoint_address with the actual endpoint addresses for your specific region. The end of this article contains links to the endpoint addresses for regions where this configuration is required.

Note

Connection strings are the new preferred method of setting custom endpoints within Application Insights.


SDK code changes

Note

The applicationinsights.config file is automatically overwritten anytime a SDK upgrade is performed. After performing an SDK upgrade be sure to re-enter the region specific endpoint values.

<ApplicationInsights>
  ...
  <TelemetryModules>
    <Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.QuickPulse.QuickPulseTelemetryModule, Microsoft.AI.PerfCounterCollector">
      <QuickPulseServiceEndpoint>Custom_QuickPulse_Endpoint_Address</QuickPulseServiceEndpoint>
    </Add>
  </TelemetryModules>
    ...
  <TelemetryChannel>
     <EndpointAddress>TelemetryChannel_Endpoint_Address</EndpointAddress>
  </TelemetryChannel>
  ...
  <ApplicationIdProvider Type="Microsoft.ApplicationInsights.Extensibility.Implementation.ApplicationId.ApplicationInsightsApplicationIdProvider, Microsoft.ApplicationInsights">
    <ProfileQueryEndpoint>Profile_Query_Endpoint_address</ProfileQueryEndpoint>
  </ApplicationIdProvider>
  ...
</ApplicationInsights>

Regions that require endpoint modification

Currently the only regions that require endpoint modifications are Azure Government and Azure China.

Region Endpoint Name Value
Azure China Telemetry Channel https://dc.applicationinsights.azure.cn/v2/track
Azure China QuickPulse (Live Metrics) https://live.applicationinsights.azure.cn/QuickPulseService.svc
Azure China Profile Query https://dc.applicationinsights.azure.cn/api/profiles/{0}/appId
Azure Government Telemetry Channel https://dc.applicationinsights.us/v2/track
Azure Government QuickPulse (Live Metrics) https://quickpulse.applicationinsights.us/QuickPulseService.svc
Azure Government Profile Query https://dc.applicationinsights.us/api/profiles/{0}/appId

If you currently use the Application Insights REST API which is normally accessed via `api.applicationinsights.io' you will need to use an endpoint that is local to your region:

Region Endpoint Name Value
Azure China REST API api.applicationinsights.azure.cn
Azure Government REST API api.applicationinsights.us

Note

Codeless agent/extension based monitoring for Azure App Services is currently not supported in these regions. As soon as this functionality becomes available this article will be updated.

Next steps