Cron Azure Function (python) failing due to Container is disposed and should not be used

Raj, Aman 1 Reputation point
2021-10-07T06:29:29.68+00:00

This is the error which i received when my Cron Azure Function executed:

Container is disposed and should not be used: Container is disposed. You may include Dispose stack-trace into the message via: container.With(rules => rules.WithCaptureContainerDisposeStackTrace())

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,403 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Pierre-Luc Giguere 1,076 Reputation points
    2021-10-08T15:10:46.54+00:00

    Hi Raj,

    Congratulations on the badges and trophies and welcome to the community.

    There is an extensive Github article that deals with triggers issues:

    https://github.com/Azure/azure-functions-host/wiki/Investigating-and-reporting-issues-with-timer-triggered-functions-not-firing

    If it does not help, please answer the following questions:

    • Are you using Consumption or App Service Plan
    • If Consumption, how did you deploy? If App Service Plan, do you have Always On enabled?
    • Are you using the v1 runtime, or the v2 (Preview) runtime?
    • Are you setting WEBSITE_TIME_ZONE?
    • What is your CRON expression set to, and what is your expectation about what it means. e.g. state "I expect it to fire every thursday at 14:17". In some cases, users just misunderstand the CRON syntax, and have incorrect expectations about the semantics of a particular expression.
    • Give a specific UTC time at which you expected your function to get called, and found that it wasn't. Also, explain how you are determining that it is not getting called. If some cases, the function may get called, but it may not be obvious due to some logging issue.
    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.