In this post we are going to see how to store the application insights in Disk and send it to azure monitor when button click, both this two operation must be in same AppDomain or AppContext.
Configure the ITelemetryChannel as store the logs in Disk path, we will store that in AppData Local Storage. The folder what we given here must be already created inside AppData. Then only the logs will be created.
Install the following package Microsoft.ApplicationInsights.AspNetCore in Asp.Net core Project. Then add the below lines in program.cs