2

I am running Visual Studio 2022 (17.0.2), and I just created a new Web API Core project from the template. I enabled Microsoft Identity as the identity provider (Azure AD).

Then I ran the solution and it brings up swagger. I did a "Try It Out" on the WeatherForecast operation. (Which failed with a 401 because the template does not enable swagger's security abilities.)

But the odd part is that in my Chrome DevTools, after the 401 line, I got this:

traking url

Why is my new project (from the standard Web API Core template) making calls to an external site? I don't have anything in my code referencing https://dc.services.visualstudio.com/v2/track. There are strict privacy laws around the code I write, and I get very nervous when there are suddenly random calls to unknown URLs.

I did some googling, and it seems this is related to something called "Microsoft Telemetry" or "Application Insights". But all the fixes that I can find have you removing or disabling code that does not come in the default WebAPI template. Like this answer.

I did see a fix that had you modify the hosts files so that the traffic would not leave your machine. That seems like it would work, but then I have to get this change done to my production machines (which I would rather not).

Why is this in there by default?

And more importantly how can I remove it so that it is not in my code when it is deployed to production?

Vaccano
  • 78,325
  • 149
  • 468
  • 850
  • Can you please share the exact steps you took to create this project? It looks like that your app is instrumented with Application Insights. – ZakiMa Jun 18 '22 at 05:29

1 Answers1

2

I believe it's this bug https://developercommunity.visualstudio.com/t/Visual-Studio-2022-Application-Insights-/1578628

The fix is to upgrade your Visual Studio (for example 17.3.0 as of June 2022).

tymtam
  • 31,798
  • 8
  • 86
  • 126