Azure App Service instrumentation for Java
Use the APM Java Library to instrument your Azure App Service to gain insights into the application process at code-level. SolarWinds Observability supports the App Service runtime with library version 3.2.2 or later.
Install
Download the library JAR and optionally the JSON config file:
-
https://github.com/solarwinds/apm-java/releases/latest/download/solarwinds-apm-agent.jar
-
https://github.com/solarwinds/apm-java/releases/latest/download/solarwinds-apm-config.json
Determine the App Service $HOME (Linux) or %HOME% (Windows) directory. Upload the library JAR to a directory under its wwwroot, for example:
-
Linux
/home/site/wwwroot/apm/solarwinds-apm-agent.jar -
Windows
C:\home\site\wwwroot\apm\solarwinds-apm-agent.jar
This can be done via the Azure portal by using Development Tools > Advanced Tools, or with file deployment methods described in Deploy Files - Azure App Service.
Configure
Environment variables supported by APM Java can be set as app settings, in the Azure portal this is under Settings > Environment variables > App settings. These are the required settings:
| Name | Value |
|---|---|
| SW_APM_SERVICE_KEY | The service name portion, that is, the string after :, is ignored and the App Service app name (WEBSITE_SITE_NAME) is used as the SolarWinds Observability service name. To override with an explicit service name, set the OTEL_SERVICE_NAME variable. |
| SW_APM_COLLECTOR |
Determine based on your data center, for example:
|
Enable
-
Set an environment variable
JAVA_TOOL_OPTIONSthat instructs the JVM to load the APM library as a javaagent. Examples with the JAR location from the install section:-
Linux
-javaagent:/home/site/wwwroot/apm/solarwinds-apm-agent.jar -
Windows
-javaagent:C:\home\site\wwwroot\apm\solarwinds-apm-agent.jar
-
-
Restart the App Service.