Improve Azure App Service Performance by Disabling Application Insights Snapshot Debugger and Profiler
When you enable Application Insights on your Azure App Service, you gain powerful monitoring capabilities. However, two additional diagnostic tools—Snapshot Debugger and Profiler—can silently impact your application’s performance if left enabled without careful consideration.
-
Both Snapshot Debugger and Profiler attach extra processes/components (e.g., Snapshot Uploader, profiler agent) to your App Service worker process to monitor exceptions and collect traces.
-
When exceptions occur, Snapshot Debugger must analyze them, decide whether to capture, create a minidump, compress it, and upload it, which consumes CPU, memory, and disk I/O for tens to hundreds of seconds per snapshot.
-
Continuous or sampling-based profiling of live requests always adds some overhead; independent testing shows increased CPU usage and response times (for example, roughly 5–20% relative increase in CPU and latency when profiler sampling is active).
- Based on the number of errors or slowness these can be also more aggressive – also depending on the SKU, if the machine might be already at let’s say 40% CPU –> you can see sometimes 40% additional CPU from SD while collecting traces.
I heard that the best method is to disable the Debugger and Profiler using Azure Portal. Using CLI you can invoke:
# Disable Profiler and Code Optimizations
az webapp config appsettings set –resource-group $(ResourceGroupName) –name $(AppService2Name) –settings APPINSIGHTS_PROFILERFEATURE_VERSION=disabled
# Disable Snapshot Debugger
az webapp config appsettings set –resource-group $(ResourceGroupName) –name $(AppService2Name) –settings APPINSIGHTS_SNAPSHOTFEATURE_VERSION=disabled
# Disable Diagnostic Extension
az webapp config appsettings set –resource-group $(ResourceGroupName) –name $(AppService2Name) –settings DiagnosticServices_EXTENSION_VERSION=disabled