Deploy functions
After you have build and tested your function, it’s time to deploy it to STACKIT Functions for real.
To do so, you can follow these steps:
- Get the ID of the Registry credential you want the STACKIT Functions to use, using the STACKIT Functions CLI:
This command will print out a list of registry credentials configured in your project; pick the one matching the image you want to deploy.sfn config registry list - Invoke the
pushsubcommand to upload the image to the OCI registry:
(Note:sfn function pushpushwill pick the right registry from the--imageflag you passed tosfn function buildearlier. If you need to override the image for the deployment process, you can also pass the--imageflag to thedeployandpushsubcommands) - Invoke the
deploysubcommand to create the STACKIT Functions configuration. Make sure to pass the correct--registry-id:
(Note:sfn function deploy --registry-id=<registry credential id>deployalso has options for building and pushing as part of the same step. See thesfn function deployreference for more details.)
Once the deployment process completes, you should get a message similar to the following:
Name: your-function-name
ID: 00000000-0000-0000-0000-000000000000
Created: 1234-05-06T07:08:09.101112Z
Updated: 1234-05-06T07:08:09.101112Z
URL: 00000000-0000-0000-0000-000000000000.functions.onstackit.cloud
Follow the URL displayed by the command to see your function running on the STACKIT Functions runtime!
Note: It might take about a minute for your newly-deployed function revision to become available.
Note: Check out the Troubleshooting guide if your function is not available even after a minute has passed.