General Questions - My 1st function

Todd 21 Reputation points
2022-11-29T22:49:18.667+00:00

Hi,

Use case is connecting an Azure Database for MySQL Database to a Power App. Very simple for SQL but not so for MySQL.

My journey so far is that I have learnt (not proven yet) that a Power App Custom Connector can talk to an Azure Function (provided it is written in certain languages. (Not Python but 1 option is Node.JS)

So I have created my 1st Function in Node which is a simple select * from table by following this MS Article

This works when I run inside of Kudu but when I test on the portal it doesn't.

Should it run inside the portal when I select test? Should it be a get or a post?

Note that I created the folder, uploaded my js file and ran a couple commands to add the Function

Error message that I get on the test page of the Azure portal is

500 Internal Server Error

Error message in the monitor tab is

Unable to determine function entry point. If multiple functions are exported, you must indicate the entry point, either by naming it 'run' or 'index', or by naming it explicitly via the 'entryPoint' metadata property.' Stack: Error: Worker was unable to load function ListBrands: 'Unable to determine function entry point. If multiple functions are exported, you must indicate the entry point, either by naming it 'run' or 'index', or by naming it explicitly via the 'entryPoint' metadata property.' at C:\Program Files (x86)\SiteExtensions\Functions\4.14.0\workers\node\dist\src\worker-bundle.js:2:13853 at t.LegacyFunctionLoader.<anonymous> (C:\Program Files (x86)\SiteExtensions\Functions\4.14.0\workers\node\dist\src\worker-bundle.js:2:14092) at Generator.next (<anonymous>) at o (C:\Program Files (x86)\SiteExtensions\Functions\4.14.0\workers\node\dist\src\worker-bundle.js:2:12538) at processTicksAndRejections (node:internal/process/task_queues:96:5)

Thanks in advance

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

1 answer

Sort by: Most helpful
  1. MughundhanRaveendran-MSFT 12,506 Reputation points
    2022-12-01T06:32:39.717+00:00

    @Todd ,

    Please make sure your primary entry point function is named run or index and try again.

    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)

    Similar issue: https://stackoverflow.com/questions/43702177/unable-to-determine-function-entry-point

    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.