This post was most recently updated on May 12th, 2021.2 min read.
This article describes a curious fix I found to an issue where Application Insights (seemingly) crashes your Azure App Service, leaving behind interesting and non-descriptive errors in the Application Event Logs.
The actual symptoms might be your Azure app service just timing out with no errors being surfaced on the front-end.
Does your Azure App Service’s event log look like this? Full of “Production Breakpoints” with weird errors about named pipes?
In my case, the errors were something like these below:
IfFailRet(pNamedPipe->Read((BYTE*)&controlRequest, sizeof(SnapshotHolderControlStruct))) failed in function CSnapshotHolder::HandleNewPipeConnection: -2147024787
CNamedPipe::Read - Read from named pipe failed: 0x8007006D.
CInstrumentationMethod::Initialize - failed to initialize instrumentation method PID: 12196 hr: 80131375 name: Production Breakpoint Instrumentation Method
These errors would always pop up at the same time the site would crash under fairly meager load. In one case, any user would crash the site. In another, a hundred or so RPS (requests per second) would completely destroy a site that’s supposed to be able to handle tens of thousands.
Impossible to tell whether the errors were logged because of the crash, or the app service crashed because of the same thing that caused the errors…
After a quick investigation, Application Insights seemed to be the source (“Production Breakpoints”) for the error. I had never heard of AppInsights crashing an App Service, but we did eas
This didn’t completely remove the issue, but did stabilize the app service. But how to get rid of the errors for good?
There’s a simple fix, though! Or at least there was for me. Maybe it’ll help you as well!
Okay, so the solution for me was kind of weird – but easy.
Earlier, when I had first had Azure DevOps enable “Monitoring”, it would install AppInsights extension to the Azure App Service website.
That’s a horrible mistake. Don’t do that.
The extensions are extremely fragile. I’ve posted about that earlier: You wouldn’t believe these 3 solutions to fix the error “500.32”, and what they look like now!
Anyway – the extensions are kind of wild as they also add random application settings to your app service. And these settings have side effects – like in this case!
I had removed the extension, and we were using AppInsights with the SDK, i.e. without anything extra installed on the Azure App Service. But uninstalling the extension does not remove its Application Settings – which makes sense, because they DO have side effects, so you can’t really remove them, because some other functionality might be using them as well!
Oh, what fun.
Time needed: 5 minutes.
- Open Azure Portal
- Navigate to “Configuration”
- Remove the property called “SnapshotDebugger_EXTENSION_VERSION”
Anyway, long story short – remove this property “SnapshotDebugger_EXTENSION_VERSION”:
And with any luck, you’re good!