A10 - architecture design

question

solution

ARM / resource layer

rg-detector-ml
├── Azure Machine Learning Workspace
├── Azure Storage Account
├── Azure Key Vault
├── Azure Container Registry      [if required]
└── monitoring/support resources  [as required]
Requirement Azure ML concept
Interactive development Compute instance
Weekly production training Compute cluster
Connection to 400 GB storage Datastore
Named/versioned training dataset Data asset
Reproducible Python runtime Environment
Training execution Command job

storage

Azure Storage
└── telemetry/
    ├── historical/
    ├── week-001/
    ├── week-002/
    └── ...
detector-training-data
├── v1
├── v2
├── v3
└── ...

compute

environment

detector-training-env:v1
├── suitable base runtime
├── Python 3.11
├── pandas
├── scikit-learn
└── MLflow

production training job

CODE
./src
└── train.py

COMMAND
python train.py
    --data ${{inputs.training_data}}
    [other configurable parameters]

DATA
detector-training-data:vN

ENVIRONMENT
detector-training-env:vN

COMPUTE
cpu-training-cluster

outputs and metrics

Train
  ↓
Candidate model
  ↓
Evaluate
  ↓
Quality gates
  ├── FAIL → reject
  └── PASS
        ↓
     register
        ↓
consider promotion/deployment

Actions ID

GitHub Actions
      ↓
GitHub identity token
      ↓
Microsoft Entra federation
      ↓
Azure access token
      ↓
RBAC authorization
      ↓
Azure CLI
      ↓
submit Azure ML job

reproducibility and lineage

MODEL v17
├── Azure ML / MLflow run ID
├── source repository
├── Git commit
├── training code
├── training data asset + version
├── underlying immutable/versioned data
├── environment + version
├── relevant dependency/container versions
├── compute configuration
├── hyperparameters
├── random seed where relevant
├── evaluation metrics
│   ├── precision
│   ├── recall
│   └── F1
└── model artifact

architecture

detector-ml/
├── src/
│   ├── train.py
│   └── evaluate.py
├── tests/
│   └── ...
├── jobs/
│   └── train.yml
├── environments/
│   └── conda.yml
├── infra/
│   └── main.bicep
└── .github/
    └── workflows/
        └── train.yml
                         GIT REPOSITORY
                               │
                               ▼
                        GitHub Actions
                               │
                        workload federation
                               │
                               ▼
                        Microsoft Entra ID
                               │
                         RBAC authorization
                               │
                               ▼
                           Azure ML
                               │
                               │ submit
                               ▼
                         COMMAND JOB
                               │
		┌────────────────┼────────────────┐
		 ▼                                               ▼                                               ▼
		CODE                                    DATA                           ENVIRONMENT
	    train.py                      training-data:vN                          env:vN
                               │
                               ▼
                         CPU CLUSTER
                         min_nodes=0
                               │
                               ▼
                            TRAIN
                               │
			  ┌────────────┴────────────┐
			  ▼                                                                          ▼
		   METRICS                                                         ARTIFACT
	 precision/recall/F1                                                     model.pkl
			  │                                                                         │
			  └────────────┬────────────┘
                               ▼
                           EVALUATE
                               │
                         QUALITY GATE
                          ┌────┴────┐
                          ▼                           ▼
                        FAIL                 PASS
                          │                          │
                        reject                     ▼
                                   REGISTER