Search code examples
azure-functionsazure-functions-runtime

Azure Function: Insufficient memory to continue the execution of the program


Trying to run an Azure Functions project locally and get the following error:

Insufficient memory to continue the execution of the program.

This happens before anything is logged or startet so there is nothing to debug.

Anyone have any clue how to debug this?

I've deleted all the code, removed all dependencies. All there is left is a default timer function with no implementation. It still do not work.

If i create a new function project, func init, everything works. I can't see any difference in the project file, host.json, local.settings.json, function.json etc. between the project that do not work and the project that do work.

I'm thinking of reimplementing the project and copying over all the code, but is this the only solution?


Solution

  • If you add an empty value "":"" into the Values collection in the local.settings.json file, it can create this issue. Seems like a bug, or bad error message? I have created a github issue with the func guys, here. https://github.com/Azure/azure-functions-core-tools/issues/1732 and made a pull request to fix it, https://github.com/Azure/azure-functions-core-tools/pull/1735 . Hope this helps!

    Update 2022-03-15: The PR above was completed and only fixed func v2. @ejizba is enhancing and pushing through a fix for func v3 and v4 in this new PR here.