graph LR
A[CSV Upload] --> B[Blob Storage input/]
B --> C[Event Grid]
C --> D[Dispatcher Function]
D --> E[Worker Function - Blob Trigger]
E --> F[ML API - Container Apps]
F --> G[Cosmos DB]
G --> H[Dashboard]
- Dataset : Titanic (Kaggle) — 891 passagers, 7 features
- Tâche : Classification binaire (survie ou non)
- Modèle : RandomForest (100 estimateurs, seed=42)
- Accuracy : 0.8212
- F1 Score : 0.8199
- Version : model_v1.0.0.pkl
- Azure CLI
- Docker Desktop
- Azure Functions Core Tools v4
- Python 3.11
# 1. Créer le Resource Group
az group create --name rg-projet-ml --location switzerlandnorth
# 2. Storage Account
az storage account create --name stprojetml2026 --resource-group rg-projet-ml --location switzerlandnorth --sku Standard_LRS
# 3. Containers
az storage container create --name input --account-name stprojetml2026
az storage container create --name output --account-name stprojetml2026
az storage container create --name models --account-name stprojetml2026
# 4. ACR
az acr create --name acrprojetml2026 --resource-group rg-projet-ml --location switzerlandnorth --sku Basic --admin-enabled true
# 5. Cosmos DB
az cosmosdb create --name cosmos-projet-ml-2026 --resource-group rg-projet-ml --locations regionName=switzerlandnorth --capabilities EnableServerless
az cosmosdb sql database create --account-name cosmos-projet-ml-2026 --resource-group rg-projet-ml --name titanic-db
az cosmosdb sql container create --account-name cosmos-projet-ml-2026 --resource-group rg-projet-ml --database-name titanic-db --name inferences --partition-key-path "/id"
# 6. Build et push Docker
docker build -t acrprojetml2026.azurecr.io/titanic-api:v1.0.0 ./api
az acr login --name acrprojetml2026
docker push acrprojetml2026.azurecr.io/titanic-api:v1.0.0
# 7. Container Apps
az containerapp env create --name cae-projet-ml --resource-group rg-projet-ml --location switzerlandnorth
az containerapp create --name titanic-api --resource-group rg-projet-ml --environment cae-projet-ml --image acrprojetml2026.azurecr.io/titanic-api:v1.0.0 --target-port 8000 --ingress external --min-replicas 0 --max-replicas 3
# 8. Function App
az functionapp create --name func-projet-ml-2026 --resource-group rg-projet-ml --storage-account stprojetml2026 --consumption-plan-location switzerlandnorth --runtime python --runtime-version 3.11 --functions-version 4 --os-type linux
cd functions && func azure functionapp publish func-projet-ml-2026 --forcecurl -X POST https://titanic-api.wonderfulpond-f7e17ee3.switzerlandnorth.azurecontainerapps.io/predict \
-H "Content-Type: application/json" \
-d '{"Pclass":3,"Sex":1,"Age":22,"SibSp":1,"Parch":0,"Fare":7.25,"Embarked":2}'Réponse :
{"prediction": 0, "label": "Not Survived", "confidence": 0.88, "model_version": "1.0.0"}traces
| where timestamp > ago(24h)
| where message contains "WORKER TERMINÉ"
| summarize count() by bin(timestamp, 1h)
| render timecharttraces
| where message contains "WORKER TERMINÉ"
| extend duration = todouble(extract("duration: ([0-9.]+)", 1, message))
| top 5 by duration descrequests
| where timestamp > ago(24h)
| summarize count() by resultCode
| render piechart| Service | SKU | Coût estimé |
|---|---|---|
| Container Apps | Consumption | ~$0 (scale to 0) |
| Functions | Consumption | ~$0 (1M free) |
| Cosmos DB | Free Tier | ~$0 |
| Storage | Standard LRS | ~$0.02 |
| ACR | Basic | ~$5 |
| Event Grid | - | ~$0 (100K free) |
| Total | ~$5/mois |
azure-ml-pipeline/
├── api/ # FastAPI + Dockerfile
├── functions/ # Azure Functions
├── model/ # Training + modèle exporté
├── web/ # Dashboard HTML
├── tests/ # Tests E2E
├── docs/ # Diagrammes
└── .github/workflows/ # CI/CD