Azure Machine Learning REST API
The Azure Machine Learning REST API enables you to create, manage, and deploy machine learning models using standard HTTP verbs. The API supports workspace management, model registration, online endpoints, and job execution.Authentication
Azure Machine Learning REST API uses OAuth2 service principal authentication.Retrieve Authentication Token
1
Get Service Principal Credentials
Obtain your tenant ID, client ID, and client secret from your Azure service principal.
2
Request Access Token
3
Use Token in Requests
Include the token in the Authorization header:
Base URL
Workspaces
List Workspaces
Retrieve all Azure Machine Learning workspaces in a resource group. Endpoint:string
required
Your Azure subscription ID
string
required
Name of the resource group
Create Workspace
Create a new Azure Machine Learning workspace. Endpoint:string
required
Azure region for the workspace
string
required
Resource ID of the Azure Storage account
string
required
Resource ID of the Azure Key Vault
string
required
Resource ID of Application Insights
Models
Register Model
Register a trained model in your workspace. Endpoint:string
required
Unique identifier for the model
string
required
Model name
integer
required
Model version number
string
required
Path to model files in datastore
List Models
Retrieve all registered models in a workspace. Endpoint:Online Endpoints
Create Online Endpoint
Deploy a model to an online endpoint for real-time inference. Endpoint:string
required
Endpoint name (must be unique in the region)
string
Authentication mode:
Key or AADTokenstring
required
Compute resource for the endpoint
Create Deployment
Create a deployment under an online endpoint. Endpoint:string
required
Resource ID of the registered model
object
Scoring script configuration:
codeId: Resource ID of the codescoringScript: Name of the scoring script
string
required
VM size (e.g.,
Standard_DS3_v2)integer
required
Number of instances
Invoke Endpoint
Score data using a deployed model. Endpoint:string
required
Bearer token or endpoint key
string
required
application/jsonJobs
Create Training Job
Submit a training job to Azure Machine Learning. Endpoint:string
required
Job type:
Command, Sweep, Pipelinestring
required
Compute resource ID
string
required
Command to execute
string
required
Environment resource ID
Get Job Status
Retrieve job details and status. Endpoint:List Jobs
Get all jobs in a workspace. Endpoint:Compute
Create Compute Resource
Provision a compute cluster for training. Endpoint:string
required
Compute type:
AmlCompute, ComputeInstance, AKSstring
required
VM size (e.g.,
Standard_D1)object
required
Scaling configuration:
minNodeCount: Minimum nodesmaxNodeCount: Maximum nodesnodeIdleTimeBeforeScaleDown: Idle time before scale down
List Compute Resources
Endpoint:API Versioning
Always specify the
api-version parameter. Current stable version: 2023-10-01Error Responses
All errors follow Azure standard error format:Related Resources
Python SDK
Use the Python SDK for Azure ML
Azure CLI
Command-line interface for Azure ML