1
votes

I'm using Application Insights as part of my .Net Framework WebAPI project. When running the code locally (in debug mode), I can see all the events that would be sent to AI locally in Visual Studio by clicking the Application Insights button in the toolbar.

I've also got a Angular web App which works in tandem with the .Net backend. I've got the web version of Application Insights setup on it which sends telemetry to an Azure AI instance. Is it possible to have the Angular web app send its telemetry to the local AI instance in Visual Studio when I'm running it locally?

I'm using v2.5.10 of the @microsoft/applicationinsights-web library and Visual Studio Professional 2019 if that makes a difference.

1
do you mean running Angular web app in visual studio, and want to see the telemetry data in visual studio application insights search window?Ivan Yang
I run the .Net backend in Visual Studio, but the Angular app via the Angular CLI/webpack. But yes, I want the Angular apps telemetry to show up in Visual Studio, rather than being sent to the cloud AI instance.Dracs

1 Answers

1
votes

Actually, there is no local AI instance. By default, the data you see in visual studio -> Application Insights Search window is from the current debug session, the screenshot is as below:

enter image description here

Another thing is that if you specify a valid InstrumentationKey, the data are always sending to application insights in azure portal(unless you setup firewall rule to block them).

For Angular web App, there is no way to just show the data in visual studio, but not sending to AI instance in azure.

Here are some suggestions just for your reference, but they cannot totally meet your requirement:

Solution 1: Sending data from Angular web App to AI instance in azure, then you can fetch these data from azure to visual studio locally. To do that, in the visual studio -> Application Insights Search window, change the Debug session telemetry to the AI instance in azure. Like below:

enter image description here

Solution 2: If you just don't want to send the data to Azure, you can use an invalid InstrumentationKey, and then open tools like fiddler to see these telemetry data.