Get started with Azure Machine Learning
Overview
Azure Machine Learning is a cloud‑based service for building, training, and deploying machine‑learning models at scale. This guide walks you through the initial steps to start creating intelligent solutions.
Read full overviewPrerequisites
- An active Azure subscription
- Python 3.8+ installed locally
- Azure CLI (v2.30+) installed
- Basic knowledge of machine‑learning concepts
Install the required SDKs:
pip install azure-ai-ml[notebooks] --upgrade
Quickstart: Build and deploy a model
- Set up your workspace
az login
az ml workspace create -w my-ml-workspace -g my-resource-group
- Prepare a training script
# train.py
from azure.ai.ml import MLClient
from azure.identity import DefaultAzureCredential
def main():
# Dummy training code
print("Training complete!")
if __name__ == "__main__":
main()
- Submit the training job
az ml job create --file job.yml
Example job.yml:
name: iris-classifier
experiment_name: quickstart
environment: azureml:Python3.8-ubuntu20.04
code: .
command: >-
python train.py
compute: azureml:cpu-cluster
distribution:
type: tensorflow
- Deploy the model as a real‑time endpoint
az ml online-endpoint create -n iris-endpoint -f endpoint.yml
az ml online-deployment create -n default -e iris-endpoint -f deployment.yml
After deployment, you can invoke the endpoint:
curl -X POST -H "Content-Type: application/json" \
-d '{"data": [[5.1, 3.5, 1.4, 0.2]]}' \
https://.azurewebsites.net/score
Next steps
- Explore step‑by‑step tutorials
- Learn about data preparation and feature engineering
- Integrate with MLOps pipelines
- Read the best practices guide