I’m specifically using Azure App service plan - Linux | Runtime Stack Java 17 Tomcat
The code is built in Azure Devops into a .war and deployed to the app service with the AzureRmWebAppDeployment@4 task.
To troubleshoot I suggest going to the /appsvctmp/volatile/logs/runtime and checking the log files with the largest size (best to do a restart to get a new log generated). This is a copy of what the log stream feature shows in the portal but the amount of times that stream disconnects you are better off looking here.
In my case i could see the Azure start up followed immediately by a configuring tomcat and cp command for the war to tomcat hosting dir.
I then saw the Dynatrace install occur. with the start up command. Originally this was the startup.sh in /usr/local/tomcat/bin and this was spawning a new process with injection, but no traffic will hit this. ps -ef can be used to confirm the Prescence of one or more “/usr/lib/jdk/bin/java” processes. you only want one.
I found that using the Dynatrace provided startup command (in the app service config) actually fails with my setup so i copied the calling-only script below, which works for all Linux images. found on
Integrate OneAgent on Azure App Service for Linux and containers — Dynatrace Docs.
I put this script in /home by removing #!/bin/sh and using echo “script here” > dynatrace.sh
I then used /home/dynatrace.sh in the app service startup. this allowed Dynatrace to install but again it was picking up a tom cat process but no service.
I changed the app service environment variable START_APP_CMD
from /usr/local/tomcat/bin/startup.sh
to /usr/local/tomcat/bin/catalina.sh run
and finally the deep service monitoring was showing.
My advice would be to see if removing the Dynatrace startup script all together only spawns one “/usr/lib/jdk/bin/java” process. if it does re introduce the steps as i have done above. using both the logs mentioned and the ps -ef command. One other thing to make sure is i notice the deployment task AzureRmWebAppDeployment@4 also supports a start up command in our case we remove it entirely and only have it on the app service infra code not the application code deployment
Additionally you can run all the commands manually in the ssh terminal, so run the dynatrace install if its successful you can go into /opt/dynatrace/oneagent/log and check the installer log for anything. if the process is injected there should be a /java/ dir aswell. Then try the various start up scripts at this point. Hoping that no additional process is spawned and that the tomcat restart isnt instructing the underlying container to exit and restart