Introduction
Kora Chef needs its recipe API live on the internet. The brief is simple but strict: no Docker on the build machine, no registry passwords anywhere, no compute bill when nobody is calling it, and new versions released to a small share of users first, with a one-command rollback.
This is how I built and shipped it on Azure Container Apps, end to end from a WSL terminal: a private registry, a cloud image build with ACR Tasks, a container app that pulls its image with a managed identity, scale-to-zero, a v1 → v2 canary release, and the whole thing published to GitHub with a deploy script.
Repo: github.com/rahimahisah17/hostit-kora-chef
Architecture
server.js + Dockerfile
│
▼
ACR Tasks (cloud build, no local Docker)
│
▼
Azure Container Registry ── recipe-api:v1, recipe-api:v2
│ (system-assigned managed identity, AcrPull, no password)
▼
Azure Container Apps ── environment: kora-ai-env
├── revision recipe-api--v1
└── revision recipe-api--v2
• external HTTPS ingress, port 8080
• 0–5 replicas
• canary: 80/20, then 0/100
| Resource | Name |
|---|---|
| Resource group |
rg-kora-ai (North Europe) |
| Container registry |
koraaiacrri (Basic) |
| Container Apps environment | kora-ai-env |
| Container app | recipe-api |
1. Project setup
Everything lives in one Git repository from the start, so it can be pushed to GitHub at the end.
mkdir -p ~/hostit-kora-chef
cd ~/hostit-kora-chef
git init
git branch -M main
Then I confirmed which Azure subscription the CLI was pointing at before creating anything:
az account show --query name -o tsv
2. Resource group and private registry
One resource group holds everything, so a single command removes it all at the end.
az group create -n rg-kora-ai -l northeurope
az acr create -g rg-kora-ai -n koraaiacrri --sku Basic
Registry names are global across Azure, so I used a unique name (koraaiacrri) instead of the generic koraaiacr. The Basic tier is plenty for a single API.
3. The recipe API
A small Node.js service with no dependencies: no npm install, a tiny image and a fast build. It serves /, /health and /recipes (with ?q= search) as JSON on port 8080.
mkdir -p ~/hostit-kora-chef/recipe-api
cd ~/hostit-kora-chef/recipe-api
server.js (v1):
// Kora Chef recipe API: a tiny web service with no dependencies.
const http = require('http');
const VERSION = 'v1';
const PORT = process.env.PORT || 8080;
const recipes = [
{ id: 1, name: 'Jollof rice', tags: ['rice', 'spicy', 'party'], minutes: 60 },
{ id: 2, name: 'Egusi soup', tags: ['soup', 'melon seed', 'spinach'], minutes: 75 },
{ id: 3, name: 'Suya chicken skewers', tags: ['chicken', 'spicy', 'grill'], minutes: 30 },
{ id: 4, name: 'Plantain and bean stew', tags: ['vegetarian', 'beans', 'plantain'], minutes: 45 },
];
const send = (res, status, body) => {
res.writeHead(status, { 'Content-Type': 'application/json' });
res.end(JSON.stringify(body, null, 2));
};
http.createServer((req, res) => {
const url = new URL(req.url, 'http://localhost');
console.log(new Date().toISOString(), req.method, url.pathname);
if (url.pathname === '/') return send(res, 200, { app: 'Kora Chef recipe API', version: VERSION, try: ['/recipes', '/recipes?q=spicy', '/health'] });
if (url.pathname === '/health') return send(res, 200, { status: 'ok', version: VERSION });
if (url.pathname === '/recipes') {
const q = (url.searchParams.get('q') || '').toLowerCase();
const found = recipes.filter(r => !q || r.name.toLowerCase().includes(q) || r.tags.some(t => t.includes(q)));
return send(res, 200, { version: VERSION, count: found.length, recipes: found });
}
send(res, 404, { error: 'Not found', try: ['/recipes', '/health'] });
}).listen(PORT, () => console.log(`Kora Chef ${VERSION} listening on port ${PORT}`));
package.json:
4. Containerising it
The Dockerfile starts from the small official Node 20 Alpine image and runs the app as the unprivileged node user rather than root. If the app is ever compromised, the attacker doesn't get root inside the container.
A .dockerignore keeps node_modules, .git and markdown files out of the build context, and cat Dockerfile confirms what was written:
5. Building in the cloud with ACR Tasks
No Docker daemon is needed on my machine. az acr build packs the folder, uploads it (1.49 KiB here), builds the image inside Azure from the Dockerfile and pushes it to the registry.
az acr build -r koraaiacrri -t recipe-api:v1 .
The whole build and push took 22 seconds. The tag is in the registry:
az acr repository show-tags -n koraaiacrri --repository recipe-api -o table
6. The Container Apps environment
Next, the Container Apps CLI extension was brought up to date and the environment was created. The environment is the shared boundary for the app: one network and one Log Analytics workspace. Since I didn't pass a workspace, Azure generated one automatically.
az extension add --name containerapp --upgrade
az containerapp env create -g rg-kora-ai -n kora-ai-env -l northeurope
7. Running the app with a managed identity
This is the core command:
az containerapp create -g rg-kora-ai -n recipe-api \
--environment kora-ai-env \
--image koraaiacrri.azurecr.io/recipe-api:v1 \
--registry-server koraaiacrri.azurecr.io \
--registry-identity system \
--target-port 8080 \
--ingress external \
--min-replicas 0 --max-replicas 5 \
--revision-suffix v1
What each choice buys:
-
--registry-identity system: the app gets a system-assigned managed identity with the AcrPull role on the registry. There's no registry username or password stored anywhere, and nothing to rotate or leak. -
--ingress external+--target-port 8080: a public HTTPS endpoint, with TLS handled by the platform. -
--min-replicas 0 --max-replicas 5: scale to zero when idle, scale out to five copies under load. -
--revision-suffix v1: a predictable revision name (recipe-api--v1) that the release step depends on later.
Checking the address and the scale settings:
az containerapp show -g rg-kora-ai -n recipe-api --query properties.configuration.ingress.fqdn -o tsv
az containerapp show -g rg-kora-ai -n recipe-api --query properties.template.scale
rules: null means Container Apps uses its default HTTP scaling. With a 300-second cooldown, replicas are removed after five quiet minutes.
Why set scale at create time? Scale settings belong to a revision. Changing them later with az containerapp update creates a new revision with a random name, which would replace recipe-api--v1 before the release step.
8. Releasing v2 as a canary
Multiple revision mode
By default, a new revision replaces the old one. Switching to multiple revision mode lets v1 and v2 run side by side, each with its own replicas, so traffic can be split between them.
az containerapp revision list -g rg-kora-ai -n recipe-api -o table
az containerapp revision set-mode -g rg-kora-ai -n recipe-api --mode multiple
Building v2
v2 is a real code change:
- A fifth recipe (Pepper soup).
- A new route,
/recipes/<id>, that returns one recipe, or a404if the id doesn't exist. -
VERSIONset to'v2', andpackage.jsonbumped to2.0.0.
The new route:
const match = url.pathname.match(/^\/recipes\/(\d+)$/);
if (match) {
const recipe = recipes.find(r => r.id === Number(match[1]));
return recipe ? send(res, 200, recipe) : send(res, 404, { error: 'No recipe with that id' });
}
az acr build -r koraaiacrri -t recipe-api:v2 .
v1 stays in the registry untouched, so the old image is always there to roll back to.
Deploying v2 as a new revision
az containerapp update -g rg-kora-ai -n recipe-api \
--image koraaiacrri.azurecr.io/recipe-api:v2 \
--revision-suffix v2
Sending 20% of traffic to v2
Instead of moving every user at once, 20% of real traffic goes to v2, while 80% stays on the version known to work:
az containerapp ingress traffic set -g rg-kora-ai -n recipe-api \
--revision-weight recipe-api--v1=80 recipe-api--v2=20
Both revisions show 0 replicas in that list. Nobody was calling the app at that moment, so Container Apps had scaled both of them to zero: no replicas running, and no compute bill.
Proving the split
A traffic weight in a table is a claim, so I tested it by calling /health 20 times and counting which version answered:
FQDN=$(az containerapp show -g rg-kora-ai -n recipe-api --query properties.configuration.ingress.fqdn -o tsv); \
for i in $(seq 1 20); do curl -s https://$FQDN/health | grep -o '"v[12]"'; done | sort | uniq -c
16 requests went to v1 and 4 to v2, exactly 80/20. Those requests also woke the app from zero, which is why cold-start replicas appear in the next revision list.
Finishing the release
v2 was healthy, so all traffic moved to it:
az containerapp ingress traffic set -g rg-kora-ai -n recipe-api \
--revision-weight recipe-api--v1=0 recipe-api--v2=100
az containerapp revision list -g rg-kora-ai -n recipe-api -o table
v1 is still deployed at 0%. Rolling back is the same command with the weights swapped, and it takes effect in seconds.
Reading the system logs
System logs show what the platform did: image pulls, container starts and revision changes. They're the first place to look when a revision won't start.
az containerapp logs show -g rg-kora-ai -n recipe-api --type system
The logs show a v2 replica being created and started, followed by Revision 'recipe-api--v2' updated. No new revision was provisioned. That confirms the traffic change re-weighted existing revisions rather than creating a new one.
Why canary, and not the alternatives
| Strategy | How it works | Trade-off |
|---|---|---|
| Recreate | Stop v1, start v2 | Simple, but users see downtime |
| Rolling update | Replace replicas a few at a time | No downtime, but rollback means rolling back through every replica (the default for Kubernetes Deployments, and for Container Apps in single revision mode) |
| Blue-green | Two full copies, switch 0 → 100 in one move | Instant rollback, but you pay for two copies for a while |
| Canary | Small share of real traffic first, then increase | Lowest risk with real users, but needs monitoring, and both versions must work with the same backing data |
In Container Apps, multiple revision mode with traffic weights gives you both blue-green (0/100 in one move) and canary (small weights first).
9. Publishing it as a repository
Back in the project root, Git sees the untracked recipe-api/ folder:
A one-command deploy script
Every Azure command from the build went into deploy.sh, in order, with set -e so it stops at the first error. One improvement over hardcoding: the registry name is set once in an ACR= variable at the top. Anyone, including me, can point it at a different registry by changing one line.
One caveat I documented in the README: deploy.sh builds both the v1 and v2 tags from the current recipe-api folder, which now contains the v2 code. The script replays the release steps, but on a fresh run both tags hold the same code.
The README
The README documents the architecture, the API routes, how to run it locally (Node or Docker), how to deploy it with deploy.sh, the canary commands for rollback, and clean-up. It's in the repo: hostit-kora-chef/README.md
Architecture
server.js + Dockerfile
│
▼
ACR Tasks (cloud build, no local Docker)
│
▼
Azure Container Registry ── recipe-api:v1, recipe-api:v2
│ (pulled with a system-assigned managed identity, AcrPull role, no registry password)
▼
Azure Container Apps ── environment: kora-ai-env
├── revision recipe-api--v1
└── revision recipe-api--v2
• external HTTPS ingress on port 8080
• 0 to 5 replicas (scales to zero when idle)
• canary: v1 80% / v2 20%, then v2 100%
What's in it
- Private registry: Azure Container Registry (Basic tier).
-
Cloud builds:
az acr buildbuilds and pushes the image inside Azure. - Passwordless image pull: the container app pulls from ACR with its system-assigned managed identity.
-
Scale to zero:
--min-replicas 0 --max-replicas 5. Nothing runs, and nothing is billed for compute, when there's no traffic. - Canary release: multiple revision mode, with traffic weights moved from 80/20 to 0/100. v1 stays deployed at 0% for an instant rollback.
-
Non-root container: the image runs as the unprivileged
nodeuser. -
Repeatable deploy:
deploy.shrecreates the whole setup with one command.
The API
A small Node.js API with no dependencies. It listens on port 8080 (or the PORT environment variable) and returns JSON.
| Method | Path | Returns |
|---|---|---|
GET |
/ |
App name, version and example paths |
GET |
/health |
Health check with the running version |
GET |
/recipes |
Every recipe |
GET |
/recipes?q=spicy |
Recipes whose name or tags match the search word |
GET |
/recipes/5 |
One recipe by id (v2); unknown ids return 404
|
Run it locally
With Node.js 20 or later:
cd recipe-api
npm start
In another terminal:
curl http://localhost:8080/health
curl "http://localhost:8080/recipes?q=spicy"
Or with Docker:
docker build -t recipe-api:local ./recipe-api
docker run --rm -p 8080:8080 recipe-api:local
Deploy to Azure
Requirements: an Azure subscription, the Azure CLI signed in, and Bash (Azure Cloud Shell, WSL or Git Bash).
Registry names are global across Azure, so set your own name in the ACR= line at the top of deploy.sh first.
az login
az account set --subscription "<subscription-id-or-name>"
bash deploy.sh
deploy.sh prints the app's public address. Then check it:
curl https://<app-address>/health
curl "https://<app-address>/recipes?q=spicy"
az containerapp revision list -g rg-kora-ai -n recipe-api -o table
Note:
deploy.shbuilds both thev1andv2tags from the currentrecipe-apifolder, which contains the v2 code. It replays the release steps, but on a fresh run both tags hold the same code.
Release strategy
The v2 release used a canary:
# send 20% of traffic to v2
az containerapp ingress traffic set -g rg-kora-ai -n recipe-api \
--revision-weight recipe-api--v1=80 recipe-api--v2=20
# v2 healthy: move all traffic to it
az containerapp ingress traffic set -g rg-kora-ai -n recipe-api \
--revision-weight recipe-api--v1=0 recipe-api--v2=100
Rolling back is the same command with the weights swapped.
Layout
.
├── deploy.sh
├── README.md
└── recipe-api/
├── .dockerignore
├── Dockerfile
├── package.json
└── server.js
Clean up
Azure resources cost money while they exist. Delete everything with:
az group delete -n rg-kora-ai --yes --no-wait
Author
Rahimah Sulayman: GitHub · dev.to
EOF
### Commit and push

---
## 10. Clean up
Everything was in `rg-kora-ai`, so one command removes the registry, the images, the environment, the Log Analytics workspace and the app. `--no-wait` returns immediately, and `az group exists` confirms when the deletion has finished:
bash
az group delete -n rg-kora-ai --yes --no-wait
az group exists -n rg-kora-ai
`

---
## Summary
- **Cloud-native build pipeline:** the image was built and pushed by ACR Tasks in 22 seconds, with no local Docker.
- **Zero stored credentials:** the app pulls from a private registry using a system-assigned managed identity with AcrPull.
- **Cost-aware by default:** scale-to-zero was visible in practice, with 0 replicas while idle, and capped at 5 under load.
- **Hardened container:** a minimal Alpine base image, running as a non-root user.
- **Safe, verified release:** v2 went out as an 80/20 canary, the split was measured (16/4 across 20 requests), and then it was promoted to 100%, with v1 kept for an instant rollback.
- **Operable:** system logs were used to confirm the platform's behaviour during the release.
- **Reproducible:** a parameterised `deploy.sh` and a full README, published at [github.com/rahimahisah17/hostit-kora-chef](https://github.com/rahimahisah17/hostit-kora-chef).
- **Clean exit:** every resource was removed with one command, with the deletion confirmed.
If you're hiring for Azure, DevOps or platform roles, this is the kind of work I do: secure by default, cost-conscious. Let's connect.





















Top comments (2)
One detail I didn't want to just trust: a traffic weight in a table is a claim, not proof. So before promoting v2, I hit /health 20 times and counted the versions. The result was 16 from v1 and 4 from v2, exactly 80/20. Only then did v2 get 100%.
It's also why v1 stays deployed at 0% after the release. Rollback is one command and takes seconds, without a rebuild or a redeploy.
If you're running canaries on Container Apps, how do you decide when it's safe to promote: error rate, latency, or a fixed soak time?
To your question: error rate and latency against the stable revision, gated on a minimum request count, not a fixed soak. Roughly: promote when v2's 5xx rate is within a small margin of v1's and p95 isn't worse, after a few hundred requests on the canary. A fixed soak is the fallback for low-traffic services that may never reach that count. On the 20-request check: at a 20% weight each request is routed at random, so 16/4 is a lucky split and 14/6 would be just as normal. It shows the weights are applied, not the exact ratio. Also compare like with like. With scale to zero, v2's first requests include cold starts, so its latency can look worse for reasons unrelated to the code.