GeneXus enables monitoring and analyzing the performance of applications using the features and capabilities of Azure Application Insights through instrumentation for:
- .NET Web applications running elsewhere.
- Java Web containerized applications (Deploy to Docker). As auto-instrumentation in java, consists only on attaching a Java agent JAR to any Java 8+ application. It can be done at production using infrastructure configuration.
Assuming you have already defined the Application Insights and have access to the Connection String, as the figure shows, you can follow the steps below:

- Set the Observability Provider property.
- Deploy your application.
- Configure the Environment Variables.
- Analyze the data.
Set the Observability Provider property to "Azure Monitor Application Insights" value.
In Java, use the deployment engine tool to deploy your app to Docker (builds a Docker image).
Set an environment variable pointing to the Connection String.
The environment variable should be:
APPLICATIONINSIGHTS_CONNECTION_STRING=<Connection String>
For the case of containerized applications, you set the environment variable when you run the Docker image.
If the environment variable is not set, the connection string will be calculated using a default Credential authentication flow based on the order explained here. This applies for applications that will be deployed to Azure.
docker run -p 8081:8080 -e APPLICATIONINSIGHTS_CONNECTION_STRING="InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://westus-0.in.applicationinsights.azure.com/;LiveEndpoint=https://westus.livediagnostics.monitor.azure.com/" miImageId
Note: You may need to add other environment variables, such as APPLICATIONINSIGHTS_ROLE_NAME.
The app which is going to be instrumented, and its components don't have to be hosted in Azure. The instrumentation monitors your app and directs the telemetry data to an Application Insights resource using a unique token.
For the .NET generator, for now, you need to manually add an appender to the log.config file (log4net configuration file) in order to have the log messages in Application Insights (user log messages as well as the .NET standard classes messages).
You should add an appender like the following:
<appender name="aiAppender" type="Microsoft.ApplicationInsights.Log4NetAppender.ApplicationInsightsAppender, Microsoft.ApplicationInsights.Log4NetAppender">
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%message%newline" />
</layout>
</appender>
And reference it in any logger, as shown below:
<root>
<level value="ALL"/>
<appender-ref ref="aiAppender"/>
</root>
After running the application, follow the steps in the Azure documentation to analyze the data obtained. See Distributed tracing telemetry correlation.


Generator: Java, .NET
This functionality is available since GeneXus 18 Upgrade 4.
Configuration options: Azure Monitor Application Insights for Java