top of page


  • Writer's pictureRoman Guoussev-Donskoi

Azure App Service Java Profiler

For application deployment to be supportable we need to have a clear visibility and insight into application performance and behavior.

For .NET stack Azure provides great tools to trace and visualize application performance. Now Java developers can also enjoy application profiler capabilities in Azure.

Enable java profiler

First the application needs to be instrumented with application insights. For details on this you can refer to "Azure App Service - logging and monitoring made easy"

Once you application is connected to Application Insights you can add profiler capabilities.

Profiler Agent

To enable Java profiler in Azure include application insights agent jar, profiler dll and agent config file AI-Agent.xml in your application deployment. I placed them all into "wwwroot\agent\" folder.

Note: Please use Application Insights Java SDK 2.4.0 or later.

Application Configuration

Once we have agent files ready for deployment we need to update application deployment configuration as described below. Please align application insights packages (e.g. applicationinsights-web) to 2.4.0 as well. The complete example is available in GitHub

1. pom.xml

1.1. profiler repository...





1.2. dependencies











1.3. Application Settings




<value>-javaagent:D:\home\site\wwwroot\agent\applicationinsights-agent-2.4.0.jar -agentpath:D:\home\site\wwwroot\agent\javaprofileragent.dll</value>



1.4. Configure deployment of agent files to target application



<!-- Relative path to /site/wwwroot/ -->






2. agent\AI-Agent.xml

Create a file named AI-Agent.xml and place it in the same folder as the agent JAR file.

Microsoft provides Application Insights Java Agent documentation. Snippet below shows how to configure profiler for a specific class inside "AI-Agent.xml".

<Class name="ca.ontario.gocloud.controller.JavaAIExampleController" type="Service" enabled="true">

<!--Method name="slow"





Start Profiling application

We can start with Application Map and drill down into application performance and encountered exceptions.

On Application Map select the dependency and click on "Investigate Performance".

You can enable profiler from "Configure Profiler" menu.

In "Performance" blade you can see the average duration and can dill into samples

Once found interesting sample by scrolling through samples - click on it to get further details

Then you can see the executing SQL statement and other details such as timestamp and actual duration of this execution.

We only touched on Azure Java profiler capabilities. Hope you got interested, will explore it further and leverage to your benefit.

Happy profiling :)

1,008 views0 comments

Recent Posts

See All

Query SQL using OpenAI and Langchain

LLMs (such as OpenAI) are good for reasoning but they lack capability interface with outside world. This is where Langchain agents step in: agents provide LLMs with tools to perform actions (for examp


Home: Blog2


Home: GetSubscribers_Widget


Your details were sent successfully!

Home: Contact
bottom of page