The Azure Application Insights Agent Framework causes an application to be automatically configured to work with a bound Azure Application Insights Service. Note: This framework is disabled by default.
| Detection Criterion | Existence of a single bound Azure Application Insights service.
|
| Tags | azure-application-insights=<version> |
Users must provide their own Azure Application Insights service. A user-provided Azure Application Insights service must have a name or tag with azure-application-insights in it so that the Azure Application Insights Agent Framework Framework will automatically configure the application to work with the service.
The credential payload of the service has to contain one of the following entries:
| Name | Description | Status |
|---|---|---|
connection_string |
REQUIRED for agent version 3.x+. You can find your connection string in your Application Insights resource. | ✅ Recommended |
instrumentation_key |
Required for agent version 2.x. connection_string instead. |
The instrumentation_key credential is deprecated in Azure Application Insights agent version 3.x and later.
Action Required:
- New deployments: Use
connection_stringinstead ofinstrumentation_key - Existing deployments: Migrate to
connection_stringbefore upgrading to agent v3.x
How to migrate:
- Get your connection string from your Application Insights resource in Azure Portal
- Update your user-provided service credentials:
cf update-user-provided-service my-app-insights -p '{"connection_string": "InstrumentationKey=xxx;IngestionEndpoint=https://..."}' - Restage your application:
cf restage my-app
For general information on configuring the buildpack, including how to specify configuration values through environment variables, refer to Configuration and Extension.
The buildpack includes a default AI-Agent.xml configuration file that is embedded at compile time. This provides sensible defaults for Cloud Foundry deployments.
The default configuration file is located in src/java/resources/files/azure_application_insights_agent/AI-Agent.xml.
To customize the default Azure Application Insights configuration across all applications using your buildpack:
- Fork the java-buildpack repository
- Modify the configuration file in
src/java/resources/files/azure_application_insights_agent/ - Build and package your custom buildpack
- Upload the custom buildpack to your Cloud Foundry foundation
This approach is useful for operators who want to enforce organization-wide Azure Application Insights settings.