Dit deel is nog niet vertaald. Je ziet de Engelse tekst.
$ als gewone gebruiker# als root (of met sudo)
Vaardigheden in dit hoofdstuk
- Containers en App Service-apps draaien
Store images in Azure Container Registry
ACR is a private registry in your subscription. Build images there, and give apps pull access with a managed identity.
az acr create -g rg-apps -n acrshop2026 --sku Basic
az acr login -n acrshop2026
podman tag localhost/shop:1.0 acrshop2026.azurecr.io/shop:1.0
podman push acrshop2026.azurecr.io/shop:1.0
az acr build -r acrshop2026 -t shop:1.1 .
az acr repository list -n acrshop2026 -o table| SKU | For |
|---|---|
| Basic | Labs, small teams |
| Standard | Production |
| Premium | Geo-replication, private endpoints, content trust |
Run a container with Container Instances
ACI starts one container (or a small group) in seconds, billed per second. Good for jobs and simple services.
az container create -g rg-apps -n ci-hello --image mcr.microsoft.com/azuredocs/aci-helloworld \
--ports 80 --dns-name-label hello-s0sta --cpu 1 --memory 1 --os-type Linux
az container show -g rg-apps -n ci-hello --query "{fqdn:ipAddress.fqdn, state:instanceView.state}"
az container logs -g rg-apps -n ci-hello
az container delete -g rg-apps -n ci-hello --yesRun apps on Container Apps
Azure Container Apps runs containers with HTTPS ingress, scale to zero, revisions and scale rules — Kubernetes power without managing a cluster.
az containerapp env create -g rg-apps -n cae-shop -l westeurope
az containerapp create -g rg-apps -n shop --environment cae-shop --image acrshop2026.azurecr.io/shop:1.0 \
--registry-server acrshop2026.azurecr.io --registry-identity system --ingress external --target-port 8080 \
--min-replicas 0 --max-replicas 5
az containerapp revision list -g rg-apps -n shop -o tableHost a web app on App Service
An App Service plan is the server farm (size and price). Web apps run on it — code (PHP, Python, .NET, Node …) or containers.
| Tier | Gives |
|---|---|
| Free / Shared | Tests only |
| Basic | Custom domains, manual scale |
| Standard | Autoscale, deployment slots, backups |
| Premium | More power, more slots and instances, better network options |
az appservice plan create -g rg-apps -n asp-shop --sku S1 --is-linux
az webapp create -g rg-apps -p asp-shop -n app-shop-s0sta --runtime "PHP:8.3"
az webapp config set -g rg-apps -n app-shop-s0sta --min-tls-version 1.2 --ftps-state Disabled
az webapp update -g rg-apps -n app-shop-s0sta --https-only trueScale an App Service app
Scale up = a bigger plan size. Scale out = more instances, by hand or by autoscale rules.
Deploy safely with slots
A deployment slot (for example staging) is a second live copy of the app. Deploy there, test, then swap with production — no downtime, and an easy swap back.
az webapp deployment slot create -g rg-apps -n app-shop-s0sta --slot staging
az webapp deployment slot swap -g rg-apps -n app-shop-s0sta --slot staging --target-slot productionOnthoud
Settings marked as deployment slot settings stay with the slot during a swap (for example the database connection of staging).
Add a domain, TLS and backups
Map your own domain, add a free managed certificate, and back the app up.
az webapp config hostname add -g rg-apps --webapp-name app-shop-s0sta --hostname shop.example.com
az webapp config ssl create -g rg-apps -n app-shop-s0sta --hostname shop.example.com
az webapp config ssl bind -g rg-apps -n app-shop-s0sta --certificate-thumbprint THUMBPRINT --ssl-type SNI- The domain needs a CNAME (and a TXT record
asuidfor verification) at your DNS provider. - Backups (Standard tier and up) save the app files and settings; restore them into the same or another app.
- VNet integration lets the app reach private resources; private endpoints make the app private.