Functions & templates

Functions and templates

Deploy serverless functions and apps from the template catalog.

stackblaze functions

Aliases: function, func, fn, fns

Functions live in a project environment (default production); --app is not used. new creates or updates a function from a container image; push uploads source files from a directory (dotfiles and node_modules are skipped) and, with --build, builds and deploys; invoke calls it.

usage
stackblaze functions list
stackblaze functions get <name>
stackblaze functions new <name> --image <image> [--port <n>]
stackblaze functions push <name> [--dir <path>] [--build]
stackblaze functions invoke <name> [--method <http>] [--body <text>]
stackblaze functions delete <name> [-y]
FlagDescription
--image <image>new: container image (required)
--port <n>new: container port
--name <name>new: same as the positional name
--dir <path>push: source directory (default: the current directory)
--buildpush: build and deploy after upload
--method <http>invoke: HTTP method (default POST)
--body <text>invoke: request body
-y, --yesdelete: skip the confirmation

Also accepts the scope flags (-p, --pipeline, --phase, -a, --app) and the output flags (-o, --output, --json), plus --token and --api-url. Common flags

Examples

terminal
stackblaze functions new hello --image registry.example.com/acme/hello:1.0 --port 8080
stackblaze fn invoke hello --body '{"name":"Ada"}'
stackblaze functions push hello --dir ./fn --build

stackblaze templates

Alias: template

search browses the template catalog, or searches it with a query. deploy deploys a template as a new app in the project in scope (environment default production).

usage
stackblaze templates search [query] [--category <name>] [-n <limit>]
stackblaze templates deploy <template> [options]

With deploy --wait --json, stdout carries one JSON document with the readiness check under wait; a wait that does not end ready exits 1.

FlagDescription
--category <name>search: filter by category
-n, --limit <n>search: maximum results
--name <name>deploy: app name (default: from the template)
--deployment-type <id>deploy: standard (default) or ha, when the template offers it
--env <KEY=value>deploy: override a template variable (repeatable)
--waitdeploy: wait until the app is running

Also accepts the scope flags (-p, --pipeline, --phase, -a, --app) and the output flags (-o, --output, --json), plus --token and --api-url. Common flags

Examples

terminal
stackblaze templates search postgres
stackblaze templates search --category analytics -n 5
stackblaze templates deploy n8n -p automations --name n8n --wait