A4 - architecture
- normally, a ML training architecture includes:
project/
├── train.py
├── data.csv
├── requirements.txt
└── model.pkl
# Run
>>> python train.py
- for large scare projects, Azure provides a much better architecture:

- a workspace is the top-level Azure ML resource used to organise and manage ML assets and activities
Azure subscription
│
▼
Resource Group
│
▼
Azure ML Workspace
│
├── Data assets
├── Environments
├── Jobs
├── Experiments
├── Models
├── Components
├── Pipelines
├── Compute
└── Endpoints
-
the workspace itself is a resource of type
Microsoft.MachineLearningServices/workspaces -
it is not a VM doing the training, but it manages and references compute, which executes the training job
-
the workspace does not store the assets either, rather it integrates with storage and tracks metadata/references/artifacts around these assets
-
eg: workspace has the metadata/reference for the data asset
detector-data:v3, which points to Azure storage containing actual data bytes -
workspace traditionally contains:
- storage for datasets/artifacts, outputs, logs, model files
- key vault for secure storage of secret/keys
- container registry to store container images used for ML environments/deployments
- monitoring services for operational telemetry and observability
-
they are peer resources in the resource group
Subscription
│
▼
rg-ai300-dev
├── mlw-ai300-dev ← Azure ML workspace
├── stai300dev ← Storage
├── kv-ai300-dev ← Key Vault
└── cr-ai300dev ← Container Registry

-
ML Studio is a web interface to interact with the workspace, useful for:
- inspecting jobs
- exploring assets
- configuring resources
- monitoring experiments
- viewing models
- managing endpoints
- interactive work
-
great for learning/exploration
-
SDK can be used to interact programmatically from python, useful to:
- submit jobs
- create environments
- manage data assets
- register models
- create endpoints
- build pipelines
-
great for programmatic ML workflows
from azure.ai.ml import MLClient
ml_client = MLClient(
# identity/authentication
credential=...,
# target resource
subscription_id=...,
resource_group_name=...,
workspace_name=...
)
from azure.identity import DefaultAzureCredential
-
DefaultAzureCredentialtries supported authentication mechanisms in a defined chain so that the same application can work in different environments -
application code does not need password
-
CLI can also be used to interact from the terminal/CI
-
great for automation/CI/CD
-
environments define the runtime dependencies used by jobs/deployments
-
training code + environment + compute -> training job
-
a job represents work submitted to Azure ML
-
eg: run
train.pyusing environment X on compute Y with data Z -
a job is a particular execution of ML work whereas an experiment groups/organises related runs conceptually
-
eg:
Experiment: detector-failure-model
│
├── Job/run 001
│ learning rate = .01
│
├── Job/run 002
│ learning rate = .001
│
└── Job/run 003
learning rate = .0001
- after training, the models can be registered and tracked along with metadata/lineage

# resource-management view
RESOURCE GROUP
├── Azure ML Workspace
├── Storage
├── Key Vault
└── Container Registry
# ML lifecycle view
AZURE ML WORKSPACE
├── jobs
├── models
├── data assets
├── environments
├── components
└── endpoints