See prerequisites of this sample.
The buildpack installs the Azure Application Insights Agent, and configures it for usage based on a Service Binding. This binding consists of a type indicating what type of service it is, and an InstrumentationKey with the Application Insight Instrumentation Key.
binding
├── type
└── InstrumentationKey
Add your instrumentation key to the binding
echo "<Instrumentation Key>" > binding/InstrumentationKeypack build applications/application-insights --env BP_JVM_VERSION=17 --volume "$(pwd)/binding:/platform/bindings/application-insights"docker run --rm --env SERVICE_BINDING_ROOT=/bindings --volume "$(pwd)/binding:/bindings/application" --tty --publish 8080:8080 applications/application-insightscurl -s http://localhost:8080/actuator/health | jq .