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
- 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