We have been working on getting dependency tracking working on Application insights using the following documentation:
https://docs.microsoft.com/en-us/azure/azure-monitor/app/java-get-started?tabs=maven
https://docs.microsoft.com/en-us/azure/azure-monitor/app/java-agent
Current versions we are using are:
Application Insights Agent and applicationinsights-web-auto in the POM.xml file - 2.6.1
MySQL connector - 5.1.31
Please see the attached image with the path to the AI-Agents.xml, ApplicationInsights.xml and applicationinsights-agent-2.6.1.jar -

All the attempts below have been made on both a Window and a Linux App Service.
Locally when we add all these files into the resources folder and run the application with the paths to these files configured, dependencies are tracked without a problem. However, replicating the same configuration on the App Service displays this exception:
2020-08-17T12:03:27.903658570Z: [ERROR] 17-Aug-2020 12:03:27.891 SEVERE [localhost-startStop-1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start:
2020-08-17T12:03:27.903673570Z: [ERROR] org.apache.catalina.LifecycleException: Failed to start component [/AI-Agent]
2020-08-17T12:03:27.903688470Z: [ERROR] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
2020-08-17T12:03:27.903693670Z: [ERROR] at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:754)
2020-08-17T12:03:27.903697370Z: [ERROR] at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:730)
2020-08-17T12:03:27.903701470Z: [ERROR] at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:744)
2020-08-17T12:03:27.903712370Z: [ERROR] at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:624)
2020-08-17T12:03:27.903716170Z: [ERROR] at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1833)
2020-08-17T12:03:27.903719770Z: [ERROR] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
2020-08-17T12:03:27.903723270Z: [ERROR] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2020-08-17T12:03:27.903726770Z: [ERROR] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
2020-08-17T12:03:27.903730270Z: [ERROR] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
2020-08-17T12:03:27.903733770Z: [ERROR] at java.lang.Thread.run(Thread.java:748)
2020-08-17T12:03:27.903737470Z: [ERROR] Caused by: org.apache.catalina.LifecycleException: Failed to process either the global, per-host or context-specific context.xml file therefore the
[/AI-Agent] Context cannot be started.
2020-08-17T12:03:27.903741070Z: [ERROR] at org.apache.catalina.startup.FailedContext.startInternal(FailedContext.java:199)
2020-08-17T12:03:27.903744570Z: [ERROR] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
2020-08-17T12:03:27.903748170Z: [ERROR] ... 10 more
2020-08-17T12:03:27.903751570Z: [ERROR] 17-Aug-2020 12:03:27.900 SEVERE [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDescriptor Error deploying configuration descriptor [/
home/site/wwwroot/AI-Agent.xml]
2020-08-17T12:03:27.903755270Z: [ERROR] java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [/AI-Agent]
2020-08-17T12:03:27.903758870Z: [ERROR] at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:758)
2020-08-17T12:03:27.903762370Z: [ERROR] at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:730)
2020-08-17T12:03:27.903765870Z: [ERROR] at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:744)
2020-08-17T12:03:27.903770170Z: [ERROR] at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:624)
2020-08-17T12:03:27.903773670Z: [ERROR] at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1833)
2020-08-17T12:03:27.903777270Z: [ERROR] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
2020-08-17T12:03:27.903780670Z: [ERROR] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2020-08-17T12:03:27.903784170Z: [ERROR] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
2020-08-17T12:03:27.903787670Z: [ERROR] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
2020-08-17T12:03:27.903791070Z: [ERROR] at java.lang.Thread.run(Thread.java:748)
We attempted the Java agents path as a start up command as well as a JAVA_OPTS but still getting the same exception.
From the logs above, as it was looking at AI-Agents in /home/site/wwwroot, the ApplicationInsights.xml as well as the Java Agent files were moved to this folder which also displayed the same exception but for the ApplicationInsights.xml file:
2020-08-18T11:18:54.583510165Z: [ERROR] org.apache.catalina.LifecycleException: Failed to start component [/ApplicationInsights]
2020-08-18T11:18:54.583515565Z: [ERROR] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
2020-08-18T11:18:54.583519665Z: [ERROR] at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:754)
2020-08-18T11:18:54.583523465Z: [ERROR] at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:730)
2020-08-18T11:18:54.583555865Z: [ERROR] at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:744)
2020-08-18T11:18:54.583569265Z: [ERROR] at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:624)
2020-08-18T11:18:54.583573565Z: [ERROR] at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1833)
2020-08-18T11:18:54.583577365Z: [ERROR] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
2020-08-18T11:18:54.583581365Z: [ERROR] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2020-08-18T11:18:54.583585065Z: [ERROR] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
2020-08-18T11:18:54.583588965Z: [ERROR] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
2020-08-18T11:18:54.583592665Z: [ERROR] at java.lang.Thread.run(Thread.java:748)
Please can you advice on whether any configurations are missing or if further configurations are required.
We have been working on getting dependency tracking working on Application insights using the following documentation:
https://docs.microsoft.com/en-us/azure/azure-monitor/app/java-get-started?tabs=maven
https://docs.microsoft.com/en-us/azure/azure-monitor/app/java-agent
Current versions we are using are:
Application Insights Agent and applicationinsights-web-auto in the POM.xml file - 2.6.1
MySQL connector - 5.1.31
Please see the attached image with the path to the AI-Agents.xml, ApplicationInsights.xml and applicationinsights-agent-2.6.1.jar -

All the attempts below have been made on both a Window and a Linux App Service.
Locally when we add all these files into the resources folder and run the application with the paths to these files configured, dependencies are tracked without a problem. However, replicating the same configuration on the App Service displays this exception:
2020-08-17T12:03:27.903658570Z: [ERROR] 17-Aug-2020 12:03:27.891 SEVERE [localhost-startStop-1] org.apache.catalina.core.ContainerBase.addChildInternal ContainerBase.addChild: start:
2020-08-17T12:03:27.903673570Z: [ERROR] org.apache.catalina.LifecycleException: Failed to start component [/AI-Agent]
2020-08-17T12:03:27.903688470Z: [ERROR] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
2020-08-17T12:03:27.903693670Z: [ERROR] at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:754)
2020-08-17T12:03:27.903697370Z: [ERROR] at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:730)
2020-08-17T12:03:27.903701470Z: [ERROR] at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:744)
2020-08-17T12:03:27.903712370Z: [ERROR] at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:624)
2020-08-17T12:03:27.903716170Z: [ERROR] at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1833)
2020-08-17T12:03:27.903719770Z: [ERROR] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
2020-08-17T12:03:27.903723270Z: [ERROR] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2020-08-17T12:03:27.903726770Z: [ERROR] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
2020-08-17T12:03:27.903730270Z: [ERROR] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
2020-08-17T12:03:27.903733770Z: [ERROR] at java.lang.Thread.run(Thread.java:748)
2020-08-17T12:03:27.903737470Z: [ERROR] Caused by: org.apache.catalina.LifecycleException: Failed to process either the global, per-host or context-specific context.xml file therefore the
[/AI-Agent] Context cannot be started.
2020-08-17T12:03:27.903741070Z: [ERROR] at org.apache.catalina.startup.FailedContext.startInternal(FailedContext.java:199)
2020-08-17T12:03:27.903744570Z: [ERROR] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
2020-08-17T12:03:27.903748170Z: [ERROR] ... 10 more
2020-08-17T12:03:27.903751570Z: [ERROR] 17-Aug-2020 12:03:27.900 SEVERE [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDescriptor Error deploying configuration descriptor [/
home/site/wwwroot/AI-Agent.xml]
2020-08-17T12:03:27.903755270Z: [ERROR] java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [/AI-Agent]
2020-08-17T12:03:27.903758870Z: [ERROR] at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:758)
2020-08-17T12:03:27.903762370Z: [ERROR] at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:730)
2020-08-17T12:03:27.903765870Z: [ERROR] at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:744)
2020-08-17T12:03:27.903770170Z: [ERROR] at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:624)
2020-08-17T12:03:27.903773670Z: [ERROR] at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1833)
2020-08-17T12:03:27.903777270Z: [ERROR] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
2020-08-17T12:03:27.903780670Z: [ERROR] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2020-08-17T12:03:27.903784170Z: [ERROR] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
2020-08-17T12:03:27.903787670Z: [ERROR] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
2020-08-17T12:03:27.903791070Z: [ERROR] at java.lang.Thread.run(Thread.java:748)
We attempted the Java agents path as a start up command as well as a JAVA_OPTS but still getting the same exception.
From the logs above, as it was looking at AI-Agents in /home/site/wwwroot, the ApplicationInsights.xml as well as the Java Agent files were moved to this folder which also displayed the same exception but for the ApplicationInsights.xml file:
2020-08-18T11:18:54.583510165Z: [ERROR] org.apache.catalina.LifecycleException: Failed to start component [/ApplicationInsights]
2020-08-18T11:18:54.583515565Z: [ERROR] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:167)
2020-08-18T11:18:54.583519665Z: [ERROR] at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:754)
2020-08-18T11:18:54.583523465Z: [ERROR] at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:730)
2020-08-18T11:18:54.583555865Z: [ERROR] at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:744)
2020-08-18T11:18:54.583569265Z: [ERROR] at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:624)
2020-08-18T11:18:54.583573565Z: [ERROR] at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1833)
2020-08-18T11:18:54.583577365Z: [ERROR] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
2020-08-18T11:18:54.583581365Z: [ERROR] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
2020-08-18T11:18:54.583585065Z: [ERROR] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
2020-08-18T11:18:54.583588965Z: [ERROR] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
2020-08-18T11:18:54.583592665Z: [ERROR] at java.lang.Thread.run(Thread.java:748)
Please can you advice on whether any configurations are missing or if further configurations are required.