02 - First Deploy (Consumption)¶
Deploy the app to Azure Functions Consumption (Y1) using long-form CLI commands only. This tutorial uses Linux examples and notes Windows support where relevant.
Prerequisites¶
| Tool | Version | Purpose |
|---|---|---|
| Node.js | 20+ | Local runtime and package execution |
| Azure Functions Core Tools | v4 | Local host and publishing |
| Azure CLI | 2.61+ | Azure resource provisioning and management |
| Azure subscription | Active | Target for deployment |
Consumption plan basics
Consumption (Y1) is serverless with scale-to-zero, up to 200 instances, 1.5 GB memory per instance, and a default 5-minute timeout (max 10 minutes).
What You'll Build¶
You will provision a Linux Function App on the Consumption plan, publish your Node.js v4 app, and validate trigger discovery.
Infrastructure Context
Plan: Consumption (Y1) | Network: Public internet only | VNet: ❌ Not supported
Consumption has no VNet integration or private endpoint support. All traffic flows over the public internet. Storage uses connection string authentication.
flowchart TD
INET[Internet] -->|HTTPS| FA[Function App\nConsumption Y1\nLinux Node.js 20]
FA -->|connection string| ST[Storage Account\npublic access]
FA --> AI[Application Insights]
subgraph STORAGE[Storage Services]
ST --- FS[Azure Files\ncontent share]
end
NO_VNET["⚠️ No VNet integration\nNo private endpoints"] -. limitation .- FA
style FA fill:#0078d4,color:#fff
style NO_VNET fill:#FFF3E0,stroke:#FF9800
style STORAGE fill:#FFF3E0 flowchart LR
A[Set variables + login] --> B[Create RG + storage]
B --> C[Create function app]
C --> D[Set placeholder settings]
D --> E["func azure functionapp publish"]
E --> F[Validate endpoints] Steps¶
Step 1 - Set variables and sign in¶
export RG="rg-func-node-consumption-demo"
export APP_NAME="func-ndcons-$(date +%m%d%H%M)"
export STORAGE_NAME="stndconsdev$(date +%m%d)"
export LOCATION="koreacentral"
az login
az account set --subscription "<subscription-id>"
Storage account name limits
Storage account names must be 3-24 characters, lowercase letters and digits only. The $STORAGE_NAME pattern above keeps names short to stay within limits.
Step 2 - Create resource group and storage account¶
az group create --name "$RG" --location "$LOCATION"
az storage account create \
--name "$STORAGE_NAME" \
--resource-group "$RG" \
--location "$LOCATION" \
--sku Standard_LRS \
--kind StorageV2
Step 3 - Create function app¶
az functionapp create \
--name "$APP_NAME" \
--resource-group "$RG" \
--storage-account "$STORAGE_NAME" \
--consumption-plan-location "$LOCATION" \
--runtime node \
--runtime-version 20 \
--functions-version 4 \
--os-type Linux
Auto-created Application Insights
az functionapp create automatically provisions an Application Insights resource and links it to the function app. You do not need to create one manually unless you want a custom name or configuration.
Step 4 - Set placeholder trigger settings¶
STORAGE_CONN=$(az storage account show-connection-string \
--name "$STORAGE_NAME" \
--resource-group "$RG" \
--output tsv)
az functionapp config appsettings set \
--name "$APP_NAME" \
--resource-group "$RG" \
--settings \
"QueueStorage=$STORAGE_CONN" \
"EventHubConnection=Endpoint=sb://placeholder.servicebus.windows.net/;SharedAccessKeyName=placeholder;SharedAccessKey=placeholder;EntityPath=placeholder" \
"TIMER_LAB_SCHEDULE=0 */5 * * * *"
Placeholder settings prevent host errors
The Node.js v4 reference app includes triggers for Queue, EventHub, and Timer. If these connection settings are missing, the Functions host enters an Error state and cannot index any functions. Use placeholder values until real resources are provisioned.
Step 5 - Publish app¶
Upload size
Node.js function apps include node_modules in the deployment package, resulting in ~49 MB uploads. This is significantly larger than Python (~2 MB). The upload may take a few minutes on slower connections.
Step 6 - Validate deployment¶
# List deployed functions
az functionapp function list \
--name "$APP_NAME" \
--resource-group "$RG" \
--output table
# Test the health endpoint
curl --request GET "https://$APP_NAME.azurewebsites.net/api/health"
# Test the hello endpoint
curl --request GET "https://$APP_NAME.azurewebsites.net/api/hello/Azure"
Step 7 - Review Consumption-specific notes¶
- Use
--consumption-plan-locationfor app creation and expect cold starts under idle periods. - Use long-form CLI flags for maintainable runbooks.
- Keep
FUNCTIONS_WORKER_RUNTIME=nodeacross all environments.
Verification¶
Function list output (showing key fields):
[
{
"name": "helloHttp",
"type": "Microsoft.Web/sites/functions",
"invokeUrlTemplate": "https://<app-name>.azurewebsites.net/api/hello/{name?}",
"language": "node",
"isDisabled": false
}
]
Language field is node, not Javascript
The language field in the function list output returns "node" for Node.js v4 apps deployed to Linux Consumption. Earlier documentation may show "Javascript" — this is incorrect for current deployments.
Health endpoint response:
Hello endpoint response:
Next Steps¶
Next: 03 - Configuration
See Also¶
- Tutorial Overview & Plan Chooser
- Node.js Language Guide
- Platform: Hosting Plans
- Operations: Deployment
- Recipes Index