Azure Function - what about the function.json file?

Nico 0 Reputation points
2024-04-24T11:30:55.1566667+00:00

Hey there,

I remember, that defining Azure Functions in VS Code in TypeScript was done, by creating an index.ts and a corresponding function.json file. At least, this was the way with Azure Functions 1.x.

Now, using 4.4.0 I noticed, that even the "func new" command only creates a .ts-File but not a function.json. It also uses a app-Object, imported from @azure/functions. But when I do it this way, publishing the functions does not work. It uploads the code, but no Function is created.

What am I doing wrong?

Thanks for any hint!

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

1 answer

Sort by: Most helpful
  1. Pieter de Bruin 321 Reputation points Microsoft Employee
    2024-06-13T12:54:38.98+00:00

    Hi Nico,

    Sorry to hear about your experience.

    Can you share more details about your environment and steps to reproduce the issue?

    Additionally, I just created a new ts function, which seems to work fine. Maybe you can use this to troubleshoot yours? https://github.com/pdebruin/functionsts/tree/main/1http

    It also looks like your are caught between v3 and v4 of the programming model, which can be confusing. There is a blog post that discusses the changes https://techcommunity.microsoft.com/t5/apps-on-azure-blog/azure-functions-node-js-v4-programming-model-is-generally/ba-p/3929217 and there is a migration guide to move from v3 to v4 https://learn.microsoft.com/azure/azure-functions/functions-node-upgrade-v4

    Hope this helps,

    Pieter

    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.