1 h 45 (S8.1 : 15 min · S8.2 : 45 min · S8.3 : 45 min)
modules 3 (CLI, Bicep), 4 (spokes) and 7 (portal on VMs, autoscale)
portal v2 on web01 / web02 behind lbe-stNN-web, API on vmss-stNN-api deallocated, Owner of rg-stNN-app
15 min
Operations effort = VM (IaaS) > Containers > App Service (PaaS)| Layer | VM (M7) | Containers (ACI, AKS) | App Service |
|---|---|---|---|
| Hardware, virtualization | Azure | Azure | Azure |
| OS, patches | Arvéo | Azure (host), Arvéo (image) | Azure |
| Runtime (nginx, Node.js) | Arvéo | Arvéo (image) | Azure |
| Code, configuration, data | Arvéo | Arvéo | Arvéo |
Before (M7): Ubuntu image + cloud-init + extensions + monthly patches (2 VMs)
After (PaaS): zip archive → az webapp deploy (OS and Node.js maintained by Azure)
App Service = Plan (region, tier, instances) + Apps (code or container)flowchart LR PLAN[asp-st07-portail<br/>S1 Linux, 2 instances] --> APP[app-st07-portail-2610<br/>production] APP --> SLOT[Slot<br/>staging] PLAN --> APP2[Other app<br/>same plan]
<app>.azurewebsites.net, TLS certificate providedTier = Features (slots, scaling) + Hardware (size) + Isolation| Tier | Max instances | Slots | Scaling |
|---|---|---|---|
| Free F1, Shared D1 | 1 (shared) | 0 | None |
| Basic B1 to B3 | 3 | 0 | Manual |
| Standard S1 to S3 | 10 | 5 | Automatic (rules) |
| Premium v3, v4 | 30 | 20 | Rules or automatic |
| Isolated v2 (ASE v3) | 100 | 20 | Rules |
[TO VERIFY] on the "App Service limits" page; Premium v4: limited regionsScale up = Higher tier or size | Scale out = More instancesCpuPercentage, HttpQueueLength) or schedule[TO VERIFY]ARR affinity on = client pinned to one instance (turn it off when stateless)
Monthly cost = Tier hourly price × Instance count × Hours[TO VERIFY][TO VERIFY] pricing calculator)Customer portal: Standard S1 (slots + autoscale), 2 instances minimum
Exercise 08.1: choose the plan for four apps (4 min, in pairs)
45 min
az appservice plan create -g rg-st07-app -n asp-st07-portail --is-linux --sku S1 \
--tags $TAGS -o none
az webapp create -g rg-st07-app -p asp-st07-portail -n app-st07-portail-2610 \
--runtime "NODE:22-lts" --tags $TAGS \
--query "{Name:name, Host:defaultHostName, State:state}" -o tableExpected output:
Name Host State
--------------------- --------------------------------------- -------
app-st07-portail-2610 app-st07-portail-2610.azurewebsites.net Running2610 as suffixaz webapp list-runtimes --os linux (NODE:22-lts [TO VERIFY])<name>-<hash>.<region>.azurewebsites.net)Deployment = Source (zip, Git repo, image) + Channel (CLI, pipeline, Kudu)| Method | Use | Arvéo |
|---|---|---|
Zip archive (az webapp deploy) |
Manual, scripts | Labs 08.2 and 08.3 |
| GitHub Actions, Azure Pipelines | CI/CD | Project target |
| Container image (ACR) | Containerized app | Bonus 4 |
| Run from package | Zip mounted read-only | Option |
<name>.scm.azurewebsites.net): deployment engine, logs, consoleSCM_DO_BUILD_DURING_DEPLOYMENT): npm install at deployment, useless here[TO VERIFY]Configuration = App settings + General settings + Securityaz webapp update -g rg-st07-app -n app-st07-portail-2610 \
--https-only true --client-affinity-enabled false -o none
az webapp config set -g rg-st07-app -n app-st07-portail-2610 \
--startup-file "node server.js" --min-tls-version 1.2 --ftps-state Disabled \
--always-on true --generic-configurations '{"healthCheckPath": "/health"}' -o none
az webapp config appsettings set -g rg-st07-app -n app-st07-portail-2610 \
--settings SCM_DO_BUILD_DURING_DEPLOYMENT=false \
--slot-settings ARVEO_ENV=production -o noneprocess.env; Key Vault references possible/health: failing instance removed from load balancing (≥ 2 instances)server.js and package.json at the ROOT of the archive./scripts/labs/module-08/empaqueter-portail.sh v3
az webapp deploy -g rg-st07-app -n app-st07-portail-2610 \
--src-path ~/arveo-build/portail-v3.zip --type zip -o none
curl -s https://app-st07-portail-2610.azurewebsites.net/Expected output (1 to 2 min; instance ID varies):
/home/<USER>/arveo-build/portail-v3.zip
server.js
package.json
<h1>Arveo - portail client v3</h1><p>App Service - production - instance 3f9c1a2b</p>az webapp log tail (after az webapp log config)az webapp restart (all instances of the plan)Slot = Full-fledged app (host name, configuration) + Same planflowchart LR DEV[Team<br/>portail-v4.zip] -->|deploy --slot staging| STG[staging<br/>recette] STG -->|Swap<br/>after warm-up| PROD[production<br/>app-st07-portail-2610] PROD -.->|Rollback<br/>new swap| STG
<app>-staging.azurewebsites.netSlot setting = Stays attached to its slot during a swap| Swapped with the code | Stays in the slot |
|---|---|
| Unmarked app settings | Slot settings (ARVEO_ENV) |
| Runtime, startup command | Scale settings, Always On |
| Unmarked connection strings | VNet integration, access restrictions |
| Deployed content (zip, image) | Custom domains, managed identity |
az webapp deployment slot swap -g rg-st07-app -n app-st07-portail-2610 \
--slot staging --target-slot productionPLAN_ID=$(az appservice plan show -g rg-st07-app -n asp-st07-portail --query id -o tsv)
az monitor autoscale create -g rg-st07-app -n as-st07-portail --resource "$PLAN_ID" \
--min-count 2 --max-count 4 --count 2 -o none
az monitor autoscale rule create -g rg-st07-app --autoscale-name as-st07-portail \
--condition "CpuPercentage > 70 avg 10m" --scale out 1 -o none
az monitor autoscale rule create -g rg-st07-app --autoscale-name as-st07-portail \
--condition "CpuPercentage < 30 avg 15m" --scale in 1 -o noneaz webapp list-instances; WEBSITE_INSTANCE_ID read by the code2 instances minimum in production (useful health check, maintenance without downtime)
Inbound = Public | Access restrictions | Private endpointOutbound = Shared outbound IPs | VNet integrationflowchart LR CLI[Internet<br/>clients] -->|HTTPS| APP[app-st07-portail] APP -->|VNet integration<br/>snet-appsvc| ACI[Private API<br/>snet-aci] APP -.->|Without integration| NET[Internet<br/>shared IPs]
45 min
Image = File layers + Metadata (port, command)Container = Running image (isolated process)2.0) or digest (sha256:<digest>)FROM, COPY, EXPOSE, CMD)Before (M7): VMSS + cloud-init → instance ready in 3 to 5 min, nginx updated on each VM
After (M8): image api-suivi-colis:2.0 → container ready in seconds, update = new image
ACR = Registry (<name>.azurecr.io) + Repositories + Tags + Entra ID authentication| Tier | Included storage | Key features |
|---|---|---|
| Basic | 10 GiB | Labs, development |
| Standard | 100 GiB | Production, higher throughput |
| Premium | 500 GiB | Geo-replication, private link |
AcrPull / AcrPush role; admin account disabledaz acr build), no Docker on the workstationaz acr import (avoids Docker Hub limits)crarveost072610[TO VERIFY] on the ACR pricing pageARG IMAGE_BASE=mcr.microsoft.com/azurelinux/base/nginx:1.25
FROM ${IMAGE_BASE}
COPY nginx.conf /etc/nginx/nginx.conf
EXPOSE 8080
CMD ["nginx", "-g", "daemon off;"]az acr build -r crarveost072610 -t arveo/api-suivi-colis:2.0 scripts/labs/module-08/api
az acr repository show-tags -n crarveost072610 --repository arveo/api-suivi-colis -o tsvExpected output (excerpt, 1 to 2 min):
Run ID: ca1 was successful after 48s
2.0[TO VERIFY] on D-1; fallback: --build-arg IMAGE_BASE=nginx:1.27-alpineACI = Container group (IP, ports) + Resources (vCPU, GB) + Restart policyAlways (service), OnFailure or Never (one-off job)SYSTEM-assigned managed identity not supported to pull an image from ACR
AcrPull role on the registry ONLYID=$(az identity create -g rg-st07-app -n id-st07-aci --tags $TAGS --query id -o tsv)
PID=$(az identity show --ids "$ID" --query principalId -o tsv)
ACR_ID=$(az acr show -n crarveost072610 --query id -o tsv)
az role assignment create --assignee-object-id "$PID" \
--assignee-principal-type ServicePrincipal --role AcrPull --scope "$ACR_ID" -o none
az container create -g rg-st07-app -n aci-st07-api --os-type Linux \
--image crarveost072610.azurecr.io/arveo/api-suivi-colis:2.0 \
--acr-identity "$ID" --assign-identity "$ID" --cpu 0.5 --memory 0.5 \
--ports 8080 --dns-name-label arveo-st07-api-2610 --tags $TAGS -o none
curl -s http://arveo-st07-api-2610.francecentral.azurecontainer.io:8080/Expected output (role assignment propagated in 1 to 2 min):
{"service":"api-suivi-colis","version":"2.0","plateforme":"conteneur","instance":"<HOST>"}Container Apps = Environment (network, logs) + Apps + Revisions + Scale rules[TO VERIFY]containerized APIs and microservices without a dedicated Kubernetes team
AKS = Control plane (managed) + Node pools (VMSS) + Kubernetes objects (pods, services)flowchart LR CP[Control plane<br/>managed by Azure] --> NP[Node pool<br/>VMSS 2 × B2s_v2] NP --> POD[Pods<br/>api-suivi-colis × 3] ACR[crarveoformation<br/>AcrPull] -.-> NP
[TO VERIFY]kubectl scaleChoice = Desired control ↔ Accepted operations effort| Need | Service |
|---|---|
| Non-containerized software, OS access | VM, VMSS (M7) |
| Web app or API, source code | App Service |
| Single container, one-off job | ACI |
| Microservices, scale to zero | Container Apps |
| Full Kubernetes orchestration | AKS |
| Event-driven code, short-lived | Azure Functions |
az acr build + user-assigned identity (AcrPull): no secret to manageARVEO_ENV)docker buildaz acr buildaz acr importaz container createAcrPull role on the registryNever or OnFailure