Azure Function App Function stopping execution

Dustin Chavez 80 Reputation points
2025-12-17T16:50:54.18+00:00

I have an Azure Function App with a function that takes approximately 10 minutes to execute as it moves files between storage locations. I'm experiencing inconsistent behavior when running multiple invocations concurrently, even though single invocations work perfectly fine.

When I trigger the function once, it executes successfully and completes within the expected timeframe. However, when I trigger 40 invocations of this function, the behavior is very different. Under the Invocations tab in the Azure portal, I only see one successful invocation recorded, even though there should be 40 total invocations showing up. Additionally, based on my application logging, I can confirm that approximately 15 out of the 40 executions actually complete successfully, which doesn't match what the Invocations tab is showing.

I have configured the function with "functionTimeout": "-1" to allow unlimited execution time, and this setting has been working correctly for longer executions in the past. I also have "dynamicConcurrencyEnabled": true. I'm trying to understand why the invocations are stopping early and why there's such a discrepancy between what's shown in the portal versus what my logs indicate.

My questions are: Why are the invocations not appearing in the Invocations tab even though they're executing? Why do only about 15 out of 40 invocations complete when run concurrently? Are there concurrency limits or throttling mechanisms that could be causing this behavior?

We are using EP1 for the app service plan, and it is triggered an event grid event when a blob is created.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
{count} votes

2 answers

Sort by: Most helpful
  1. Q&A Assist
    2025-12-17T16:51:10.5066667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    The behavior you're experiencing with your Azure Function App could be attributed to several factors related to concurrency limits and execution timeouts. Here are some insights:

    1. Invocation Visibility: The discrepancy between the number of invocations recorded in the Azure portal and your application logs could be due to the Azure Functions runtime's handling of concurrent executions. If the function is being triggered by an event grid event, it may be subject to throttling or limits imposed by the Azure Functions service, especially if the function is taking a long time to execute.
    2. Concurrency Limits: Azure Functions have built-in concurrency limits, which can affect how many instances of a function can run simultaneously. For the Consumption plan, the default limit is typically set to a maximum of 200 concurrent executions, but this can vary based on the plan you are using. Since you mentioned using the EP1 plan, you may want to check the specific concurrency limits associated with that plan.
    3. Execution Timeouts: Although you have set "functionTimeout": "-1", which allows for unlimited execution time, there are still other factors that could lead to early termination of function executions. For example, if the function is being invoked via HTTP, the Azure Load Balancer has a maximum idle timeout of 230 seconds, which could affect long-running HTTP-triggered functions. Additionally, if the function app is under heavy load, it may not be able to allocate resources for all concurrent invocations, leading to some executions being dropped.
    4. Scaling Behavior: The Azure Functions platform may not scale out quickly enough to handle the burst of 40 concurrent invocations, especially if each invocation is resource-intensive. You might want to consider implementing Durable Functions or using an asynchronous pattern to manage long-running tasks more effectively.

    To summarize, the issues you're facing could be due to concurrency limits, execution timeouts, and scaling behaviors of your Azure Function App. It may be beneficial to monitor the performance metrics and logs to identify any specific errors or throttling events that could provide further insights into the problem.


    References:

    0 comments No comments

  2. Pravallika KV 4,755 Reputation points Microsoft External Staff Moderator
    2025-12-17T17:12:57.4866667+00:00

    @Dustin Chavez ,

    Thanks for reaching out to Microsoft Q&A.

    The inconsistent behavior when running multiple concurrent invocations in your Azure Function could be caused by the below factors:

    1. Event Grid may be delivering events faster than your function can process, causing some events to be missed or retried. Check Event Grid delivery logs to see if any events are being dropped or delayed.
    2. While the EP1 plan supports auto-scaling, there are still limits on the number of instances up to 50. Running 40 concurrent invocations may exceed the capacity, especially if your function is resource-heavy (e.g., large file transfers). Review your scaling settings and consider adjusting the maxConcurrentCalls setting in your host.json to control concurrency.
    3. If your function is moving large files between storage locations, Azure Blob Storage may throttle requests, causing delays or failures in some invocations. Monitor your Storage Metrics to identify any throttling.
    4. Despite being on EP1, the function may face cold start issues or resource contention when scaling under heavy load. Consider setting a minimum instance count to mitigate cold starts.
    5. Monitor Application Insights for detailed logging on invocations and errors.
    6. Review and adjust scaling and concurrency settings to ensure your function can handle high load efficiently.
    7. As an alternative, you can use a queue-based trigger i.e., Azure Storage Queue or Service Bus to decouple Event Grid and your function, allowing for better flow control.

    By addressing these factors, you should be able to resolve the discrepancies in invocations and improve reliability when running multiple concurrent executions.

    Hope it helps!


    Please do not forget to click "Accept the answer” and Yes, this can be beneficial to other community members.

    User's image

    If you have any other questions, let me know in the "comments" and I would be happy to help you.

    0 comments No comments

Your answer

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