Installation
azureml-core==1.56.0- Azure ML SDKazure-ai-ml==1.23.1- Azure ML v2 SDKazure-identity- Azure authenticationazure-storage-blob==12.17.0- Blob Storage SDKadlfs>=2021.10.0- Azure Data Lake Storage filesystemkubernetes- Kubernetes Python client
Available Components
The Azure integration provides these stack components:AzureML Orchestrator
Execute pipelines using Azure Machine Learning
AzureML Step Operator
Run individual steps on AzureML compute
Azure Artifact Store
Store artifacts in Azure Blob Storage
Authentication
There are three ways to authenticate with Azure:1. Service Connector (Recommended)
2. Explicit Service Principal
3. Default Azure CLI Credentials
If no credentials are provided, ZenML uses Azure CLI credentials:AzureML Orchestrator
The AzureML orchestrator runs your complete pipeline as an Azure ML pipeline.Configuration
subscription_id- Azure subscription IDresource_group- Azure resource group nameworkspace_name- AzureML workspace name
compute_target_name- Default compute target for pipeline stepstenant_id- Azure tenant ID (if using service principal)service_principal_id- Service principal client IDservice_principal_password- Service principal secret
AzureML Workspace Setup
Create an AzureML workspace:Service Principal Permissions
Create a service principal with required permissions:Step-Level Settings
Customize individual steps with AzureML-specific settings:compute_target_name- Azure ML compute target for this stepenvironment_variables- Environment variables for the step
Compute Target Types
AzureML supports various compute targets: Compute Clusters (AmlCompute):- Auto-scaling clusters
- Cost-effective for batch workloads
- Supports CPU and GPU VMs
- Always-on development VMs
- Jupyter notebooks included
- Good for interactive development
| VM Size | vCPUs | RAM | GPU | Use Case |
|---|---|---|---|---|
| STANDARD_D2_V2 | 2 | 7 GB | - | Light workloads |
| STANDARD_D4_V2 | 8 | 28 GB | - | Standard training |
| STANDARD_NC6 | 6 | 56 GB | 1x K80 | GPU training |
| STANDARD_NC12 | 12 | 112 GB | 2x K80 | Multi-GPU training |
| STANDARD_ND40rs_v2 | 40 | 672 GB | 8x V100 | Large-scale training |
AzureML Step Operator
The step operator runs individual steps as AzureML jobs.Configuration
Usage
Azure Blob Storage Artifact Store
Store artifacts in Azure Blob Storage.Configuration
az://container-name or abfs://[email protected].
Storage Account Setup
Access Configuration
Grant access to the storage account:Complete Stack Example
Here’s a complete production-ready Azure stack:Best Practices
Use Managed Identity
Use Managed Identity
When running from Azure VMs or AKS, use managed identity instead of service principals:
Enable Auto-Scaling
Enable Auto-Scaling
Configure compute clusters to auto-scale for cost efficiency:
Use Azure Key Vault
Use Azure Key Vault
Store secrets in Azure Key Vault:
Enable Private Link
Enable Private Link
Use Private Link for secure connectivity:
Common Issues
Authentication Failures
Authentication Failures
If you see authentication errors:
- Verify service principal credentials are correct
- Check service principal has required role assignments
- Ensure subscription ID and tenant ID are correct
- Try running
az loginif using CLI credentials
Compute Not Available
Compute Not Available
If compute target is unavailable:
- Check compute cluster exists in the workspace
- Verify compute is not in failed state
- Check quota limits in the subscription
- Ensure compute name matches configuration
Storage Access Denied
Storage Access Denied
If artifact storage fails:
- Verify storage account and container exist
- Check service principal has “Storage Blob Data Contributor” role
- Ensure path format is correct (
az://container-name) - Check firewall rules if using private endpoints
Next Steps
Azure Artifact Store
Configure Blob Storage for artifacts
Service Connectors
Advanced authentication options
Remote Execution
Production deployment patterns
AzureML Documentation
Official Azure ML docs
