Trouble loading Node Azure Functions locally on Mac

69 views Asked by At

I am building a Static Web App using Node functions for an API. Everything works when deployed to Azure, but I cannot run locally on Mac. I am able to run locally on Windows. I am using the new v4 programming model, using this pattern:

app.http('my-cool-func', {
    route: "my/cool/route",
    methods: ['GET'],
    authLevel: 'anonymous',
    handler: async (request: HttpRequest): Promise<HttpResponseInit> => {
        ...
    }
});

On Windows, when I punch in:

func --version

I get: 4.0.5441. When I kick off my /api folder directly with func start, it identifies the functions correctly and all is well.

On Mac, when I ask for the func version, I get 4.0.3971. I installed it using brew (following these directions):

brew tap azure/functions
brew install azure-functions-core-tools@4

However, according to this guide, which also provides the exact same installation instructions:

Make sure you install version v4.0.5382 of the Core Tools, or a later version.

This note is only present when that article is set to v4 mode; it disappears when setting it to v3 mode. One presumes that some glitch has been fixed between here and there, and that the glitch is relevant only for v4-mode implementations. Perhaps something to do with detecting the presence of functions?

Anyway, upon kicking off the same /api folder with func start on the Mac, I receive the unfortunately familiar message:

No job functions found. Try making your job classes and methods public. If you're using binding extensions ... etc.

Is there an updated version of the Azure Functions Core Tools I can get my hands on for Mac? How can I install it, if not using brew?

1

There are 1 answers

1
PramodValavala On

This is likely due to the v4 Programming Model like you suspected. Based on this table, you need a host runtime of at least 4.25 which is available in version 4.0.5357 of Azure Functions Core Tools onwards.

I don't have a mac to try out the homebrew install but you should be able to download a newer release from the releases pages directly for now.