Skip to main content

Quickstart: Get Started with Azure Machine Learning

In this quickstart, you create the resources needed to start working with Azure Machine Learning and train your first model.
This tutorial uses Azure Machine Learning studio for a streamlined getting-started experience. You can also use the SDK, CLI, or Azure portal.

Prerequisites

What You’ll Create

Workspace

Central resource to view and manage all ML artifacts

Compute Instance

Preconfigured cloud resource for development and training

Step 1: Create a Workspace

The workspace is the top-level resource for your machine learning activities, providing a centralized place to view and manage artifacts.
1

Sign in to Azure ML Studio

Navigate to Azure Machine Learning studio and sign in with your Azure account.
2

Create Workspace

Select Create workspace and provide the following information:
FieldDescription
Workspace nameEnter a unique name (case-insensitive)
Friendly nameOptional display name with spaces/special characters
HubLeave blank if you don’t have access to a hub
3

Configure Advanced Settings

If you didn’t select a hub, provide:
  • Subscription: Your Azure subscription
  • Resource group: Use existing or create new
  • Region: Select closest to your users/data
4

Create

Select Create to provision the workspace and all required resources.
Workspace creation automatically provisions Azure Storage, Container Registry, Key Vault, and Application Insights.

Step 2: Create a Compute Instance

A compute instance is a preconfigured cloud-based compute resource for running Jupyter notebooks and Python scripts.
1

Open Workspace

Select your newly created workspace in the studio.
2

Create Compute

  1. On the top right, select New
  2. Select Compute instance from the list
3

Configure Instance

  • Name: Enter a unique compute instance name
  • Virtual machine size: Keep default or select based on needs
  • Settings: Keep defaults unless required by policy
4

Review and Create

Select Review + Create, then Create
The compute instance will incur costs while running. Enable idle shutdown to minimize costs.

Step 3: Explore Azure ML Studio

The studio provides a comprehensive interface for machine learning development:

Authoring Section

Create and run Jupyter notebooks with built-in compute integration
  • Clone sample notebooks
  • Create custom notebooks
  • Run Python scripts

Assets Section

Track resources created during ML development:
  • Data: Registered datasets and data assets
  • Models: Trained and registered models
  • Environments: Software dependencies
  • Components: Reusable pipeline steps
  • Jobs: Training run history

Manage Section

Create and configure compute and external services:
  • Compute instances and clusters
  • Datastores and connections
  • Endpoints for deployment
  • Data labeling projects

Step 4: Run Your First Notebook

1

Access Samples

  1. Navigate to Notebooks in the left menu
  2. Select the Samples tab at the top
2

Clone Example

  1. Open the SDK v2 folder
  2. Browse to a tutorial notebook
  3. Select Clone this notebook to copy to your workspace
3

Run Notebook

  1. Open the cloned notebook from Files
  2. Select your compute instance at the top
  3. Run cells using Shift+Enter or the Run button

Connect to Your Workspace Programmatically

After creating your workspace, connect using the SDK:
from azure.ai.ml import MLClient
from azure.identity import DefaultAzureCredential

# Enter your workspace details
subscription_id = "<SUBSCRIPTION_ID>"
resource_group = "<RESOURCE_GROUP>"
workspace_name = "<WORKSPACE_NAME>"

# Connect to workspace
ml_client = MLClient(
    DefaultAzureCredential(),
    subscription_id,
    resource_group,
    workspace_name
)

print(f"Connected to workspace: {ml_client.workspace_name}")

Sample Training Job

Submit a simple training job using the Python SDK:
from azure.ai.ml import command
from azure.ai.ml import Input

# Define training job
job = command(
    code="./src",
    command="python train.py --data ${{inputs.data}}",
    inputs={
        "data": Input(type="uri_folder", path="azureml://datastores/workspaceblobstore/paths/data")
    },
    environment="AzureML-sklearn-1.0@latest",
    compute="cpu-cluster",
    display_name="quickstart-training-job",
)

# Submit job
returned_job = ml_client.jobs.create_or_update(job)
print(f"Job submitted: {returned_job.name}")

Cost Management

To avoid charges when resources are idle:
  • Compute clusters: Set minimum nodes to 0
  • Compute instances: Enable idle shutdown
  • Serverless compute: No configuration needed - automatically scales to zero
You still pay for disk, public IP, and load balancer when compute instance is stopped.

Next Steps

Train Your First Model

Learn how to train machine learning models

Workspace Concepts

Deep dive into workspace features

Compute Resources

Understand compute options

Deploy Models

Deploy models to production

Additional Resources

Build docs developers (and LLMs) love