Skip to content

Functions

A function is a request-driven container (Knative Serving). It scales to zero when idle and cold-starts on the first request. It is not an always-on service.

Always-on service Canvas service · stays running Replica 1 ready Replica 2 ready Public HTTPS Replicas stay running when idle APIs, frontends, workers Function Knative Serving · not a canvas service Request Cold start 1 replica serves the request Idle · scale to zero Prebuilt image · invoke URL · same environment add-ons

Functions live in the same project environment as your apps and can use the same private add-ons. The public invoke URL looks like:

https://<name>-<project>-<environment>.fn.<domain>

The image must already exist in a registry the cluster can pull. StackBlaze does not build functions from source — you push a prebuilt image.

On the canvas, add a function from the functions surface for that environment. Set image, port, env, and scale bounds.

Terminal window
stackblaze functions list
stackblaze functions new --name hello --image ghcr.io/org/fn:tag
stackblaze functions invoke hello
stackblaze functions delete hello

Feature tools are fn__* (list_functions, get_function, deploy_function). Same image-already-built rule.

If you need a long-running HTTP API, use a service instead.