'Unable to determine function entry point

Been using MS botframework for a couple months. Developing with the emulator in node and using continuous integration to push to Azure.

Pushed last Wednesday and tested with no problems. Made two very inconsequential code changes and pushed on Friday and no I'm getting:

Exception while executing function: Functions.messages. mscorlib: Unable to determine function entry point. I tried redeploying the older version, same thing.

Thoughts?



Solution 1:[1]

The function entrypoint is determined based on this logic. As you can see, the flow is:

  1. If an explicit entry point is defined in function.json, use that
  2. Otherwise; if there's a single exported function, use that
  3. Otherwise; try to use a function named run or index (in that order)

I suspect you were in branch #2, and your minor change introduced new functions, so the runtime is now attempting to locate a function named run or index and that doesn't exist.

Can you please make sure your primary entry point function is named run or index and try again?

Solution 2:[2]

1) Try stopping the service in Azure:

Stop the Service

2) Then go to Kudu: https://[YourAzureSiteName].scm.azurewebsites.net/DebugConsole

and run npm install:

npm install

3) Then restart the service in Azure

Solution 3:[3]

You can use module.exports for example:

module.exports = async function queryDatabase() {

    const pg = require('pg');
    //...
    //...
}

Solution 4:[4]

In my case, the root cause is having 1 named export & 1 default export. To fix this, only export default 1 thing in the entrypoint file (index.js in my case) Leaving here as a trail in case someone faces the same thing

Solution 5:[5]

if you are exporting multiple functions for example function1, function2 then by adding this line to the end of file we can resolve this issue.

exports.index = function1

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Fabio Cavalcante
Solution 2 Eric Dahlvang
Solution 3 Álvaro Agüero
Solution 4 Lalaland
Solution 5