To have your application logs at Azure Application Insights in a .NET application, you can use the Log output property with the "Azure Application Insights" option.
In this case, your application (regardless if it runs locally or in the cloud) sends the application logs to Azure App Insights.
The only configuration consideration you have to make is to define an environment variable called APPLICATIONINSIGHTS_CONNECTION_STRING pointing to your Application Insights resource. In the cloud, the environment variable is defined as an App Setting.
As the following figure shows, the GX_LOG_LEVEL environment variable should also be set to be able to configure the level of detail that the log will have. See Log level property.

Then, going through the Application Insights menu, enable it, and select the resource to access the information.


At the Application Insights panel, you can make queries to get the information of your logs.

Troubleshoot-diagnostic-logs