Install APM Insight Java Agent in Azure Web App
- Create a new directory under <APP_HOME>/WEB-INF/lib, say appmanager.
- Download latest the APM Insight java agent zip file (apminsight-javaagent.zip) here
- Extract the zip file to a appmanager directory to find agent jar and its configuration files.
- Open the apminsight.conf file in any text editor and include the following keys:
license.key=[LICENSE KEY]
apm.host=http://[HOST]:[PORT]
Example:
license.key=APMI_74447444b666d7ab5174cc3021a9b68dd4b3364d50f99c2969360810313e8fac
apm.host=http://apm-prod-server:9090
To learn more about the configurations, visit our Configuration Guide page.
- Bundle your application and deploy it in Azure WebApp service.
- Add the below JVM argument in App Settings under Settings of your WebApp. Refer to screenshot.
- If using Tomcat server, please add Key "CATALINA_OPTS" and value as
-javaagent:/usr/home/tomcat/webapps/ROOT/WEB-INF/lib/appmanager/apminsight-javaagent.jar
- If using Jetty server, please add Key "JAVA_OPTIONS" and value as
-javaagent:D:/home/site/wwwroot/webapps/{APP_NAME}/WEB-INF/lib/appmanager/apminsight-javaagent.jar
- Restart your Webapp once for changes to take effect.
Note:
- You can also configure a secure APM URL. Ensure that the connection is stable and free from certificate-related issues.
Example: https://apm-prod-server:8443
- For an Applications Manager failover setup, you can specify multiple hosts in a comma-separated format (supported from Java Agent v6.8), as shown below:
apm.host=http://apm-prod-server-A:9090, http://apm-prod-server-B:9090