Skip to content

CLI Cheatsheet

Quick command reference for developing and operating Azure Functions Node.js apps.

Topic/Command Groups

flowchart TD
    A[CLI Cheatsheet] --> B[Core Tools]
    A --> C[Function App]
    A --> D[Deployments]
    A --> E[Monitoring]

Core Tools

func init MyProject --worker-runtime node --language javascript --model v4
func new --template "HTTP trigger" --name httpTrigger
func start
func azure functionapp publish $APP_NAME

Azure CLI - 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
az functionapp config appsettings set --name $APP_NAME --resource-group $RG --settings "FUNCTIONS_WORKER_RUNTIME=node"
az functionapp config set --name $APP_NAME --resource-group $RG --linux-fx-version "Node|20"
az functionapp config appsettings set --name $APP_NAME --resource-group $RG --settings "WEBSITE_NODE_DEFAULT_VERSION=~20"
az functionapp log tail --name $APP_NAME --resource-group $RG
CLI element Explanation
Command(s) az functionapp create, az functionapp config appsettings set, az functionapp config set, az functionapp log tail
Key flags --name, --resource-group, --storage-account, --consumption-plan-location, --runtime, --runtime-version, --functions-version, --os-type, --settings, --linux-fx-version
Variables $APP_NAME, $RG, $STORAGE_NAME, $LOCATION
Expected result Azure CLI returns provisioning details; confirm the resource name and successful provisioning state before continuing.
  • Linux apps: use az functionapp config set --linux-fx-version "Node|20".
  • Windows apps: use WEBSITE_NODE_DEFAULT_VERSION.

Deployments

az deployment group create --resource-group $RG --template-file infra/main.bicep --parameters appName=$APP_NAME storageName=$STORAGE_NAME
CLI element Explanation
Command(s) az deployment group create
Key flags --resource-group, --template-file, --parameters
Variables $RG, $APP_NAME, $STORAGE_NAME
Expected result Azure CLI returns provisioning details; confirm the resource name and successful provisioning state before continuing.

See Also

Sources