Hi
I am experiencing recurring crashes on my Azure Function App due to a System.Net.Http.HttpRequestException
. The error message indicates an issue with an outgoing HTTP request, and it is causing the function to terminate unexpectedly.
The error message displayed in the Azure portal:
I have never experienced this in the past, but it appears as soon I click on the function app in the portal.
We identified the below thread resulted in a **System.Net.Http.HttpRequestException** for your App aardraapi and application code should be fixed to prevent impact to application availability. ``` System.Net.Http.HttpConnectionPool+<ConnectToTcpHostAsync>d__98.MoveNext System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification System.Threading.Tasks.ValueTask`1[[System.ValueTuple`2[[System.__Canon System.Private.CoreLib][System.__Canon System.Private.CoreLib]] System.Private.CoreLib]].get_Result System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable`1+ConfiguredValueTaskAwaiter[[System.ValueTuple`2[[System.__Canon System.Private.CoreLib][System.__Canon System.Private.CoreLib]] System.Private.CoreLib]].GetResult System.Net.Http.HttpConnectionPool+<ConnectAsync>d__97.MoveNext System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification System.Threading.Tasks.ValueTask`1[[System.ValueTuple`3[[System.__Canon System.Private.CoreLib][System.__Canon System.Private.CoreLib][System.__Canon System.Private.CoreLib]] System.Private.CoreLib]].get_Result System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable`1+ConfiguredValueTaskAwaiter[[System.ValueTuple`3[[System.__Canon System.Private.CoreLib][System.__Canon System.Private.CoreLib][System.__Canon System.Private.CoreLib]] System.Private.CoreLib]].GetResult System.Net.Http.HttpConnectionPool+<CreateHttp11ConnectionAsync>d__99.MoveNext System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification System.Threading.Tasks.ValueTask`1[[System.__Canon System.Private.CoreLib]].get_Result System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable`1+ConfiguredValueTaskAwaiter[[System.__Canon System.Private.CoreLib]].GetResult System.Net.Http.HttpConnectionPool+<AddHttp11ConnectionAsync>d__74.MoveNext System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[[System.__Canon System.Private.CoreLib]].GetResult System.Threading.Tasks.TaskCompletionSourceWithCancellation`1+<WaitWithCancellationAsync>d__1[[System.__Canon System.Private.CoreLib]].MoveNext System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification System.Threading.Tasks.ValueTask`1[[System.__Canon System.Private.CoreLib]].get_Result System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable`1+ConfiguredValueTaskAwaiter[[System.__Canon System.Private.CoreLib]].GetResult System.Net.Http.HttpConnectionPool+<GetHttp11ConnectionAsync>d__76.MoveNext System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification System.Threading.Tasks.ValueTask`1[[System.__Canon System.Private.CoreLib]].get_Result System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable`1+ConfiguredValueTaskAwaiter[[System.__Canon System.Private.CoreLib]].GetResult System.Net.Http.HttpConnectionPool+<SendWithVersionDetectionAndRetryAsync>d__84.MoveNext System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[[System.__Canon System.Private.CoreLib]].GetResult System.Net.Http.DiagnosticsHandler+<SendAsyncCore>d__8.MoveNext System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification System.Threading.Tasks.ValueTask`1[[System.__Canon System.Private.CoreLib]].get_Result System.Runtime.CompilerServices.ConfiguredValueTaskAwaitable`1+ConfiguredValueTaskAwaiter[[System.__Canon System.Private.CoreLib]].GetResult System.Net.Http.RedirectHandler+<SendAsync>d__4.MoveNext System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[[System.__Canon System.Private.CoreLib]].GetResult System.Net.Http.HttpClient+<<SendAsync>g__Core|83_0>d.MoveNext System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification AardraApi.devicecontrol+<Start_check>d__5.MoveNext System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw System.Threading.Tasks.Task+<>c.<ThrowAsync>b__128_1 System.Threading.QueueUserWorkItemCallback+<>c.<.cctor>b__6_0 System.Threading.ExecutionContext.RunForThreadPoolUnsafe[[System.__Canon System.Private.CoreLib]] ``` A crash happens when an exception in your code goes un-handled and terminates the process. When your application crashes, all the in-flight requests (request that are currently being processed by the app) are aborted. An end user may experience an HTTP 502 error for those requests. Azure App Service Platform has a **Proactive Crash Monitoring** feature that attaches a debugger to your process and records the call-stack of the crashing thread whenever your process crashes with an unhandled exception. If the above call stack is not helping in identifying the root cause of the crash, you can enable **Crash Monitoring** feature to collect a memory dump when the process crashes.