Node.js applications often need runtime upgrades to take advantage of new JavaScript features, improved performance, security updates, and updated npm packages. However, upgrading a local Node.js installation is only one part of the process. The cloud hosting platform must also support the selected runtime.
Azure Functions has introduced Node.js 26 support in public preview. Developers can now evaluate JavaScript and TypeScript Function Apps using this runtime on Linux in the Flex Consumption, Elastic Premium, and Dedicated hosting plans.
Flex Consumption is particularly interesting because it combines serverless execution with more control over memory, concurrency, networking, and scaling. It also supports newer Node.js versions that are not available on the older Linux Consumption plan.
This article explains how to prepare a Node.js Function App for Node.js 26, configure it for Azure Flex Consumption, build an HTTP-triggered function, and validate the application before deployment.
Understanding Node.js 26 Support in Azure Functions
Azure Functions supports multiple Node.js versions, but the available versions depend on the hosting plan and operating system.
Node.js 26 is currently in public preview and is supported on Linux. It is not available for Windows hosting plans. Linux Consumption also does not support Node.js 26.
The current support position is:
Node.js version | Support status | Hosting considerations |
|---|
Node.js 22 | Generally available | Supported on Linux and Windows |
Node.js 24 | Generally available | Supported on Linux and Windows |
Node.js 26 | Public preview | Linux only; supported on Flex Consumption, Elastic Premium, and Dedicated |
For production applications that require a fully supported runtime, Node.js 24 remains the safer choice. Node.js 26 is useful for compatibility testing and preparing applications for a future runtime upgrade.
Azure Functions continues to use the Functions runtime 4.x for these applications. Node.js 26 does not introduce a separate Azure Functions programming model.
Why Use the Flex Consumption Plan?
Flex Consumption is a Linux-based serverless hosting plan designed to provide more flexibility than the traditional Consumption plan.
It retains event-driven scaling and consumption-based billing while adding features that help developers manage application resources more precisely.
Some important capabilities include:
Scale-to-zero behavior when the application has no incoming workload.
Configurable instance memory.
Per-function scaling for supported trigger types.
Virtual network integration.
Optional always-ready instances to reduce cold starts.
Configurable concurrency for supported triggers.
For example, an HTTP function that receives occasional requests does not necessarily need a continuously running instance. Flex Consumption can scale the application based on demand. If predictable response times are important, developers can configure always-ready instances.
The plan also provides different memory configurations. The available instance sizes include 512 MB, 2,048 MB, and 4,096 MB. The appropriate selection depends on the application's memory usage, processing requirements, and concurrency.
This makes Flex Consumption a useful option for applications that need newer Node.js runtimes without moving immediately to a continuously allocated hosting plan.
Creating a Node.js 26 Function App Project
Before creating the Azure Function App, prepare the local development environment.
Install Node.js 26 and verify the installed version:
node --version
npm --version
The Node.js command should report a version beginning with v26.
Use a compatible Azure Functions Core Tools installation and the Node.js v4 programming model. The v4 programming model is recommended for new JavaScript and TypeScript applications because it defines functions directly in application code.
Create a project directory:
mkdir Node26FunctionApp
cd Node26FunctionApp
Initialize the npm project:
npm init -y
Install the Azure Functions programming library:
npm install @azure/functions
The v4 programming model uses the @azure/functions package to register triggers and bindings.
A simple project structure can look like this:
Node26FunctionApp/
│
├── src/
│ └── functions/
│ └── health.js
│
├── host.json
├── local.settings.json
├── package.json
└── package-lock.json
The functions directory contains the application functions. The host.json file contains Azure Functions host configuration, while package.json manages npm dependencies and scripts.
Building an HTTP Function With Node.js 26
Let's create a basic HTTP-triggered function that returns information about the running Node.js environment.
Create a file named health.js inside src/functions:
const { app } = require('@azure/functions');
app.http('health', {
methods: ['GET'],
authLevel: 'anonymous',
handler: async (request, context) => {
const response = {
status: 'healthy',
runtime: process.version,
platform: process.platform,
timestamp: new Date().toISOString()
};
context.log('Health endpoint executed.');
return {
status: 200,
jsonBody: response
};
}
});
The app.http() method registers an HTTP-triggered function named health.
The handler receives the incoming request and execution context. The function reads the Node.js version through process.version and returns it as part of the JSON response.
The process.platform property also helps identify the operating system on which the application is executing.
For a real application, the health endpoint can be extended to check important dependencies such as databases, external APIs, and message queues. Avoid making expensive dependency checks on every health request if the endpoint is called frequently.
Configuring the Application
Update package.json so Azure Functions can discover the function files.
A simplified configuration looks like this:
{
"name": "node26-function-app",
"version": "1.0.0",
"private": true,
"main": "src/functions/*.js",
"scripts": {
"start": "func start"
},
"dependencies": {
"@azure/functions": "^4.0.0"
}
}
The version range shown is illustrative. Use a compatible current release of the v4 programming model package and commit the package-lock.json file so the dependency tree remains reproducible.
Create a host.json file:
{
"version": "2.0"
}
For local development, create local.settings.json:
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "node"
}
}
The storage setting shown uses the local Azure Storage emulator. If the application uses triggers that require storage, make sure the local storage service is running.
Do not commit local.settings.json if it contains connection strings, passwords, or other secrets.
Running and Testing the Function Locally
Run the function application using Azure Functions Core Tools:
npm start
Core Tools starts the local Functions host and loads the application functions.
The HTTP endpoint is typically available at:
http://localhost:7071/api/health
Open the endpoint in a browser or send a request using curl:
curl http://localhost:7071/api/health
A successful response should contain information similar to this:
{
"status": "healthy",
"runtime": "v26.x.x",
"platform": "linux",
"timestamp": "2026-11-26T08:30:00.000Z"
}
The exact runtime version and timestamp will depend on the environment.
Testing locally with Node.js 26 is important, but it does not prove that the deployed Function App is using the same runtime. The Azure hosting configuration must also be checked after deployment.
Creating a Flex Consumption Function App
Create the Function App using a Linux Flex Consumption plan and select Node.js as the language runtime.
The Node.js 26 preview must be selected through the supported runtime configuration for the target environment. When using Azure CLI, the Flex Consumption creation workflow supports specifying the runtime and runtime version.
A representative command is:
az functionapp create \
--resource-group <RESOURCE_GROUP_NAME> \
--name <FUNCTION_APP_NAME> \
--storage-account <STORAGE_ACCOUNT_NAME> \
--flexconsumption-location <AZURE_REGION> \
--runtime node \
--runtime-version 26
Use an available Azure region and an appropriate storage account. The command assumes that the resource group and storage account have already been created and that the required permissions are available.
Because Node.js 26 is a preview runtime, verify that the selected region and subscription support the preview before creating the application.
Also make sure the Function App uses the Functions runtime 4.x and the Node.js v4 programming model.
Deploying the Application
After the Function App is created, deploy the application using a supported deployment method.
For example, Azure Functions Core Tools can publish the application:
func azure functionapp publish <FUNCTION_APP_NAME>
The deployment process should include the application code and the required npm dependencies. Use a compatible build environment and ensure that production dependencies are installed correctly.
For applications that include native npm modules, verify that the modules support Node.js 26 and the target Linux environment. A package that works on a Windows development machine may fail after deployment if it depends on platform-specific binaries.
After publishing, open the Function App in the Azure portal and verify its runtime configuration.
Call the health endpoint again:
curl https://<FUNCTION_APP_NAME>.azurewebsites.net/api/health
Check the returned runtime value. It should report a Node.js 26 version.
Also review the Function App logs to confirm that the function was indexed and executed successfully.
Important Considerations When Moving to Node.js 26
A runtime upgrade can affect more than the application code. It can also expose compatibility problems in the npm dependency tree.
Review npm Package Compatibility
Check whether important packages support Node.js 26. Pay particular attention to packages that use native extensions, runtime-specific APIs, or older JavaScript features.
Run the following command to inspect outdated dependencies:
npm outdated
Update packages only after checking their compatibility and testing the application.
Validate TypeScript Builds
TypeScript applications should be compiled and tested using the target Node.js version.
A typical build script might look like this:
{
"scripts": {
"build": "tsc",
"start": "func start"
}
}
Make sure the TypeScript compiler and related development dependencies support the Node.js version used by the build environment.
Review Runtime-Specific APIs
Test code that depends on Node.js modules, file handling, streams, cryptography, and networking. Runtime upgrades can reveal differences that were not visible during development with an older version.
Do Not Assume Preview Is Production-Ready
Node.js 26 support in Azure Functions is currently a public preview feature. Preview features are intended for evaluation and testing and may change before general availability.
For applications with strict production support requirements, continue using a generally available runtime until the new version reaches the required support level.
Best Practices for Running Node.js Functions on Flex Consumption
Choose the instance memory size based on actual application requirements rather than selecting the largest option by default. Monitor execution duration, memory usage, and concurrency before changing the configuration.
Use always-ready instances only when the application's response-time requirements justify the additional baseline cost. Applications with irregular workloads may benefit from allowing instances to scale to zero.
Keep secrets in application settings or an appropriate secret-management service instead of storing them in source files.
Finally, test the application under realistic conditions. Include concurrent HTTP requests, slow external services, dependency failures, and cold-start scenarios. Monitor the application after deployment to identify issues that may not appear during local testing.
Summary
Azure Functions support for Node.js 26 gives JavaScript and TypeScript developers an opportunity to test their applications against the newer runtime while continuing to use the familiar Azure Functions programming model.
The Flex Consumption plan provides a suitable serverless hosting option because it supports Node.js 26 on Linux and offers configurable memory, scaling, concurrency, and networking capabilities.
The migration process mainly involves preparing a compatible Node.js environment, reviewing npm dependencies, using the v4 programming model, configuring the Function App for Node.js 26, and validating the deployed runtime.
Since Node.js 26 is currently in public preview, developers should use it primarily for compatibility testing and evaluation. A careful migration and deployment process will make it easier to prepare applications for the runtime while avoiding unnecessary changes to existing function logic.
Join the conversation! Your thoughts help the community grow.