Dotnet-isolated .net8 function app, 502 error on consumption plan

Lewis, Leon 0 Reputation points
2024-03-07T19:21:49.47+00:00

Hi all,

I am running into a very odd error with a dotnet-isolated .net8 function app in consumption plan.

In the logs I can see after some idle time, that there is a log entry for Stopping JobHost. If I then proceed to do an http call to my Http trigger function app, after a while I will get a 502 Web server received an invalid response while acting as a gateway or proxy server. 
Open the logs there is nothing that indicated why this happened. App insights in the end to end transaction view, only shows a Faulted Result code, no explanation given.

In the logs I can the function starting, showing how it's loading the settings, printing "Starting JobHost" and Host initialized, Executing 'Function.... but then 22 seconds later I see a Stopping JobHost. No other log entry to indicate why?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,909 questions
Developer technologies C#
{count} votes

3 answers

Sort by: Most helpful
  1. hossein jalilian 10,825 Reputation points Volunteer Moderator
    2024-03-12T00:22:32.2066667+00:00

    Thanks for posting your question in the Microsoft Q&A forum.

    Implement warm-up strategies to keep the function app warm and prevent it from being unloaded during idle periods. You can use Azure Functions Premium Plan or implement a solution like Azure Application Gateway's warm-up feature.

    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful

    0 comments No comments

  2. MikeUrnun 9,777 Reputation points Moderator
    2024-03-23T00:02:45.23+00:00

    Hello @Lewis, Leon - Thanks for reaching out, and engaging the MS Q&A community.

    The error is quite generic so troubleshooting the underlying root cause may require deeper investigation in a 1:1 setting with one of our support engineers. If you'd like to try troubleshooting yourself, Diagnose and Solve problems should be able to detect the root cause and display relevant mitigating steps. Otherwise, feel free to reach out to us via email at azcommunity@microsoft.com with the following details and we'd be happy to help:

    • subject: "attn: murnun"
    • URL of this thread
    • Name of the Functions App
    • UTC timeframe of when the issue was observed

    I look forward to your reply.

    0 comments No comments

  3. Florian Wachs 101 Reputation points
    2024-04-27T12:51:51.5+00:00

    got a similar behavior. i migrated to net 8 and the aspnet integration. requests just start to not get processed and get killed by the host. it only happened on consumption plans. i had to move all the .net functions to an dedicated app service plan.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.