Action handlers are deliberately close to Azure Functions v4. This template is not Azure Functions, but the handler shape, context.log, context.invocationId, and httpResponse({...}) names are chosen so moving later is mostly mechanical.
// Here:
defineAction({
name: "syncCustomers",
methods: ["POST"],
handler: async (request, context) => {
context.log("starting sync");
return httpResponse({ status: 201, jsonBody: { count: 42 } });
},
});
// Azure Functions v4:
app.http("syncCustomers", {
methods: ["POST"],
authLevel: "function",
handler: async (request, context) => {
context.log("starting sync");
return { status: 201, jsonBody: { count: 42 } };
},
});Main differences:
- Request body here is sync:
request.body, already parsed by Express. - Azure Functions v4 uses async body helpers such as
await request.json(). - Cron should use 6-field NCRONTAB if you expect to port schedules to Timer triggers.
Useful Azure Functions docs:
- Node.js developer guide - JavaScript / TypeScript programming model.
- HTTP trigger -
app.http(), methods, routes, auth levels, request/response shape. - Timer trigger - NCRONTAB schedules and timer behavior.
- Triggers and bindings - how Functions connects to queues, blobs, databases, and other services.
- Core Tools - local Azure Functions runtime,
func start, and deployment commands. - Node.js v4 migration guide - useful when comparing this template's handler shape to real Functions v4.