How to Remove Application Insights - Stackify (2024)

By: mwatson

| March 17, 2023

How to Remove Application Insights - Stackify (1)

Microsoft’s Application Insights provides a basic application performance monitoring solution for .NET applications. For some types of .NET projects, Visual Studio will automatically add it to your solution. In this article, we are going to cover how to disable Application Insights.

Why disable Application Insights?

When considering to remove a tool that helps with monitoring, it’s worth thinking why you might want to do this. Microsoft claims that the overhead of adding Application Insights to a project is quite low. In my experience, this is generally the case—the benefits typically outweigh any issues that may come from having them in place.

With that in mind, here are a few reasons why you might want to remove Application Insights from your application:

  • Using Application Insights with Azure comes at a slight cost, depending on the traffic that the web application provides.
  • When working with your application locally, you may find that the information provided is verbose.
  • It may be unnecessary to use Application Insights for applications being hosted in development or staging environments since those environments will not have significant performance concerns.

Finally, you could just not want to use Application Insights for performance monitoring and may have other means of monitoring your application. For example, you may choose to look into Retrace, which is more fully featured and provides more functionality out of the box. Let me remind you again—if you’re going to skip performancemonitoring with Application Insights for a production application, make sure you have something else in place!

Application Insights is like a virus…

Okay, perhaps calling it a virus is a little harsh. But on a brand new project for ASP.NET on the full .NET Framework, Visual Studio adds a bunch of junk to your project.

Below are a couple screenshots showing the ApplicationInsights.config and added project dependencies.

How to Remove Application Insights - Stackify (2)

Removing Application Insights

So you’ve decided to remove Application Insights from your application. Let’s walk through the process. We’ll confirm the removal of Application Insights both on the .NET application and a deployed .NET application in Azure.

To follow through the rest of this guide, you’ll need

  • Visual Studio 2017
  • An Azure subscription
  • A .NET application that both
    • has Application Insights installed. A quick side note on this—if you’re using a .NET application running .NET Framework, Application Insights is likely installed by default; alternatively, with .NET Core, Application Insights must be explicitly installed.
    • is optionally hosted in Azure.

For this guide, I’ve created a .NET Framework web application using the template provided with Visual Studio.

First, let’s verify that Application Insights is running for your application. After creating the web application, start debugging the app, which automatically brings you to the homepage:

How to Remove Application Insights - Stackify (3)

Click a few links on the top of the application (such as About and Contact) and then head back to Visual Studio. You’ll click on the “Events” tab in “Diagnostic Tools” and see something like the following:

How to Remove Application Insights - Stackify (4)

Great! We’ve confirmed that Application Insights is running for your application. Now let’s turn off debugging mode and get to removing the package that allows for Application Insights to run. Perform one of two options to remove Application Insights from the application:

  1. Use the Package Management Console (a little faster but uses the command line).
  2. Configure using the Visual Studio NuGet UI (a little slower, but more comfortable for users unfamiliar with the CLI).

Option #1: Using the Package Management Console

First, open the Package Management Console in Tools -> NuGet Package Manager -> Package Manager Console. Enter the following command:

Uninstall-Package Microsoft.ApplicationInsights.Web -RemoveDependencies

After entering that command, the Application Insights package (along with all of its dependencies) will be uninstalled from the project.

Option #2: Using the Visual Studio NuGet UI

First, right click on the Solution and click on “Manage NuGet Packages for Solution.” Clicking this will take you to a screen that allows you to edit all of the NuGet packages that are a part of the project. Since Application Insights is a NuGet package already configured for the application, we’re just going to remove it.

Click on the package called “Microsoft.ApplicationInsights.Web,” and then check the checkbox in the project listing on the right side to select all projects. You’ll also want to remove all dependencies when uninstalling, so click on “Options” and check the option to remove dependencies under “Uninstall Options.” Your screen should look like this:

How to Remove Application Insights - Stackify (5)

How to Remove Application Insights - Stackify (6)

Once you click on “Uninstall,” a dialog will display that shows all of the unnecessary dependencies to be removed from the application. Go ahead and approve their removal.

Verifying removal of Application Insights locally

Now that you’ve performed one of the two options to remove Application Insights from your application, let’s confirm that Application Insights was removed. Start up your application in Debug mode, and check the Diagnostics Tools section after clicking a few links in the application you are debugging (such as the About or Contact links on the top of the page).

After checking, if you don’t see any Application Insights events, then you have successfully removed the Application Insights SDK from your web application.

Disabling Application Insights for ASP.NET Core with Visual Studio

With ASP.NET Core, Application Insights behaves just a little differently. It is enabled by default. To disable it within Visual Studio, you may want to use the actual Visual Studio settings to disable it.

To disable it go to “TOOLS –> Options –> Projects and Solutions –> Web Projects” and check “Disable local Application Insights for Asp.Net Core web projects.”

Below is the image for disabling local App Insights.

How to Remove Application Insights - Stackify (7)

Disabling Application Insights in some environments

If you want to just disable Application Insights in your development environment or for other scenarios, you can also just disable the telemetry in your code or leave the instrumentation key blank.

You can disable telemetry by using this code when your application starts up:

#if DEBUG
TelemetryConfiguration.Active.DisableTelemetry = true;
TelemetryDebugWriter.IsTracingDisabled = true;

#endif

If you want to disable it in just some environments, one recommendation is to set the <instrumentationKey> in ApplicationInsights.config to be blank. Then within your code, you can set the key to enable instrumentation. You may also want to do this if you want to use different keys for different environments.

#if !DEBUG Microsoft.ApplicationInsights.Extensibility.TelemetryConfiguration.Active.InstrumentationKey = “instrumentation key”;
#endif

Removing Application Insights from your application in Azure

This next step applies only to Azure-deployed .NET applications. An Application Insights Azure resource needs to be removed. After logging into the Azure portal, let’s look at the deployed application:

How to Remove Application Insights - Stackify (8)

This resource is a representation of the data your application sends to Azure to allow for monitoring events that occur in your running application. Leaving this running is unnecessary—removing Application Insights from the application makes this resource unusable.

If you are using a paid version of Application Insights, it is definitely important to disable the billing or delete the instance completely. All you need to do here is delete the Application Insights resource from Azure, and you’ll have removed Application Insights from Azure for that specific application.

How to disable Application Insights from Azure App Services

If you are using an Azure App Service, you will also want to remove the site extension for Application Insights. To remove it, go to Extensions and then click on the Application Insights extension. You can then click delete to remove Application Insights.

How to Remove Application Insights - Stackify (9)

Conclusion

Hopefully, this guide successfully walked you through how to remove Application Insights from your application. Application Insights provides some basic application performance monitoring capabilities. When you are ready to get even more insights into how your application is performing, be sure to check out our APM solution, Retrace. Give these steps a try and see if you can clean up your apps a bit and remove some unneeded clutter.

Related posts:

  • How to Use Retrace Tracked Functions to Monitor Your Code
  • Java Virtual Machine: Critical Metrics You Need to Track
  • How to Use Performance Counters with .NET Core: Current Solution, Alternatives, and the Future
  • Web Performance Optimization: Top 3 Server and Client-Side Performance Tips
  • .NET Event Counters – When logging isn’t fast enough

Improve Your Code with Retrace APM

Stackify's APM tools are used by thousands of .NET, Java, PHP, Node.js, Python, & Ruby developers all over the world.
Explore Retrace's product features to learn more.

  • App Performance Management
  • Code Profiling
  • Error Tracking
  • Centralized Logging

Learn More

How to Remove Application Insights - Stackify (15)

Author

mwatson

More articles by mwatson

How to Remove Application Insights - Stackify (2024)

FAQs

How to Remove Application Insights - Stackify? ›

To disable it go to “TOOLS –> Options –> Projects and Solutions –> Web Projects” and check “Disable local Application Insights for Asp.Net Core web projects.” Below is the image for disabling local App Insights.

How do I delete application insights data? ›

Once inside Application Insights (Classic Model) - Anyone with the permissions to run the Application Insights Purge API can delete the data (not modify). Once inside Application Insights (Workspace Model) - Anyone with the permissions to run the Workspace Purge API can delete the data (not modify).

How do I clear application insight logs? ›

The only way to do that is to delete the entire Application Insights service configuration through the portal. And currently Application Insights has 7 days retention policy, so all data will be deleted automatically in 7 days.

How do I disable application insights profiler? ›

Disable Profiler

To stop or restart Profiler for an individual app's instance: Under Settings on the left pane, select WebJobs. Select the webjob named ApplicationInsightsProfiler3 . Select Stop.

How do I turn off dependency tracking in application insights? ›

If you want to switch off the standard dependency tracking module, remove the reference to DependencyTrackingTelemetryModule in ApplicationInsights. config for ASP.NET applications.

Can you turn off application insights? ›

To resolve this issue, remove or disable Application Insights from your application. To remove the Application Insights Site Extension: Remove all settings related to Application Insights from Application > Settings > Application Settings and Save.

How do I clear application data? ›

Here's how to clear app data on Android devices: Open Settings and select Apps. Tap on the app you want to clear app data for, then select Storage followed by Clear data.

How do I remove application insights SDK? ›

How can I uninstall the SDK? To remove Application Insights, you need to remove the NuGet packages and references from the API in your application. You can uninstall NuGet packages by using the NuGet Package Manager in Visual Studio.

How do I uninstall Insight? ›

To uninstall the application:
  1. Start the program to uninstall by doing one of the following: Click the Windows Start button and select the Control Panel. ...
  2. Double-click InsightVM in the list of programs.
  3. Run the uninstaller program. The uninstaller displays a Welcome page. ...
  4. Click Next. ...
  5. Click Finish.

How do I get rid of unwanted dependencies? ›

Remove dependency in the Dependencies tool window.

Open the Dependencies tool window to find the dependency you're looking for. Select the dependency you want to remove, click the three dots on the top right of the Dependency details pane, and click Remove.

How do I turn off application data? ›

Depending on your model and version of the Android OS, the specific settings' names might be slightly different.
  1. Start the Settings app.
  2. Tap "Wireless & networks" and then tap "Data usage."
  3. Tap "Network access."
  4. In the list of apps, clear the checkbox for any apps you don't want using cellular data.
Nov 20, 2020

How do I turn off Insight notifications? ›

For Android Devices:
  1. Open the 'Settings' app on your device.
  2. Tap on 'Apps & notifications' or 'App Manager' depending on your device.
  3. Find and tap on 'Insight Timer'.
  4. Tap on 'Notifications' and turn them off.

How do I delete data from customer insights? ›

Deleting a 'Mapped' data source:

Select the entities you would like to edit or remove via 'Select'. After unticking required entities, save changes and proceed to delete the data source via 'Data Sources' on the left-hand navigation bar under 'Data'. Note that you cannot untick entities that have already been matched.

How do I clear my Analytics data? ›

Data deletion requests (Universal Analytics) [Legacy]
  1. Sign in to Google Analytics..
  2. Click Admin, and navigate to the relevant property.
  3. In the PROPERTY column, click Data Deletion Requests. ...
  4. To make a new request, click Create Data Deletion Request.
  5. Select the Start and End dates.

How do I delete application data on Mac? ›

Removing residual files
  1. Right-click Finder and select Go to Folder from the pop-up menu.
  2. Type /Library in the search bar and hit return.
  3. More advanced users know that the Library houses lots of folders, many of which contain leftover app data and service files. ...
  4. Move all the leftover app files you can find to the Trash.
Apr 8, 2024

How long does App Insights keep logs? ›

By default, Application Insights retains data for 90 days. However, you can configure the retention period to be longer or shorter depending on your needs.

Top Articles
Line Revenue and Usage Statistics in 2023
100 British pounds sterling to US dollars Exchange Rate. Convert GBP/USD - Wise
Katie Pavlich Bikini Photos
Gamevault Agent
Hocus Pocus Showtimes Near Harkins Theatres Yuma Palms 14
Free Atm For Emerald Card Near Me
Craigslist Mexico Cancun
Hendersonville (Tennessee) – Travel guide at Wikivoyage
Doby's Funeral Home Obituaries
Vardis Olive Garden (Georgioupolis, Kreta) ✈️ inkl. Flug buchen
Select Truck Greensboro
Things To Do In Atlanta Tomorrow Night
Non Sequitur
How To Cut Eelgrass Grounded
Pac Man Deviantart
Alexander Funeral Home Gallatin Obituaries
Craigslist In Flagstaff
Shasta County Most Wanted 2022
Energy Healing Conference Utah
Testberichte zu E-Bikes & Fahrrädern von PROPHETE.
Aaa Saugus Ma Appointment
Geometry Review Quiz 5 Answer Key
Walgreens Alma School And Dynamite
Bible Gateway passage: Revelation 3 - New Living Translation
Yisd Home Access Center
Home
Shadbase Get Out Of Jail
Gina Wilson Angle Addition Postulate
Celina Powell Lil Meech Video: A Controversial Encounter Shakes Social Media - Video Reddit Trend
Walmart Pharmacy Near Me Open
A Christmas Horse - Alison Senxation
Ou Football Brainiacs
Access a Shared Resource | Computing for Arts + Sciences
Pixel Combat Unblocked
Cvs Sport Physicals
Mercedes W204 Belt Diagram
Rogold Extension
'Conan Exiles' 3.0 Guide: How To Unlock Spells And Sorcery
Teenbeautyfitness
Where Can I Cash A Huntington National Bank Check
Facebook Marketplace Marrero La
Nobodyhome.tv Reddit
Topos De Bolos Engraçados
Gregory (Five Nights at Freddy's)
Grand Valley State University Library Hours
Holzer Athena Portal
Hampton In And Suites Near Me
Stoughton Commuter Rail Schedule
Bedbathandbeyond Flemington Nj
Free Carnival-themed Google Slides & PowerPoint templates
Otter Bustr
Selly Medaline
Latest Posts
Article information

Author: Delena Feil

Last Updated:

Views: 6542

Rating: 4.4 / 5 (65 voted)

Reviews: 80% of readers found this page helpful

Author information

Name: Delena Feil

Birthday: 1998-08-29

Address: 747 Lubowitz Run, Sidmouth, HI 90646-5543

Phone: +99513241752844

Job: Design Supervisor

Hobby: Digital arts, Lacemaking, Air sports, Running, Scouting, Shooting, Puzzles

Introduction: My name is Delena Feil, I am a clean, splendid, calm, fancy, jolly, bright, faithful person who loves writing and wants to share my knowledge and understanding with you.