Tutorial: Get started creating your first ML experiment

In this tutorial, you complete the end-to-end steps to get started with the Azure Machine Learning Python SDK running in Jupyter notebooks. This tutorial is part one of a two-part tutorial series, and covers Python environment setup and configuration, as well as creating a workspace to manage your experiments and machine learning models. Part two builds on this to train multiple machine learning models and introduce the model management process using both the Azure portal and the SDK.

In this tutorial, you:

  • Create a machine learning Workspace to use in the next tutorial.
  • Create a cloud-based Jupyter notebook VM with Azure Machine Learning Python SDK installed and pre-configured.


The only prerequisite for this tutorial is an Azure subscription. If you don’t have an Azure subscription, create a free account before you begin. Try the free or paid version of Azure Machine Learning service today.

Create a workspace

A workspace is a foundational resource in the cloud that you use to experiment, train, and deploy machine learning models. It ties your Azure subscription and resource group to an easily consumed object in the SDK. If you already have an Azure Machine Learning service workspace, skip to the next section. Otherwise, create one now.

  1. Sign in to the Azure portal by using the credentials for the Azure subscription you use.

  2. In the upper-left corner of Azure portal, select + Create a resource.

  3. Use the search bar to find Machine Learning service workspace.

  4. Select Machine Learning service workspace.

  5. In the Machine Learning service workspace pane, select Create to begin.

  6. Configure your new workspace by providing the workspace name, subscription, resource group, and location.

    Field Description
    Workspace name Enter a unique name that identifies your workspace. In this example, we use docs-ws. Names must be unique across the resource group. Use a name that's easy to recall and to differentiate from workspaces created by others.
    Subscription Select the Azure subscription that you want to use.
    Resource group Use an existing resource group in your subscription or enter a name to create a new resource group. A resource group holds related resources for an Azure solution. In this example, we use docs-aml.
    Location Select the location closest to your users and the data resources to create your workspace.
  7. After you are finished configuring the workspace, select Create.

    It can take a few moments to create the workspace.

    When the process is finished, a deployment success message appears. To view the new workspace, select Go to resource.

Create a cloud notebook server

This example uses the cloud notebook server in your workspace for an install-free and pre-configured experience. Use your own environment if you prefer to have control over your environment, packages and dependencies.

From your workspace, you create a cloud resource to get started using Jupyter notebooks. This resource is a cloud-based Linux virtual machine pre-configured with everything you need to run Azure Machine Learning service.

  1. Open your workspace in the Azure portal. If you're not sure how to locate your workspace in the portal, see how to find your workspace.

  2. On your workspace page in the Azure portal, select Notebook VMs on the left.

  3. Select +New to create a notebook VM.

    Select New VM

  4. Provide a name for your VM. Then select Create.


    Your Notebook VM name must be between 2 to 16 characters. Valid characters are letters, digits, and the - character. The name must also be unique across your Azure subscription.

  5. Wait until the status changes to Running.

Launch Jupyter web interface

After your VM is running, use the Notebook VMs section to launch the Jupyter web interface.

  1. Select Jupyter in the URI column for your VM.

    Start the Jupyter notebook server

    The link starts your notebook server and opens the Jupyter notebook webpage in a new browser tab. This link will only work for the person who creates the VM. Each user of the workspace must create their own VM.

  2. On the Jupyter notebook webpage, the top foldername is your username. Select this folder.


    This folder is located on the storage container in your workspace rather than on the notebook VM itself. You can delete the notebook VM and still keep all your work. When you create a new notebook VM later, it will load this same folder. If you share your workspace with others, they will see your folder and you will see theirs.

  3. Open the samples-* subdirectory, then open tutorials/tutorial-1st-experiment-sdk-train.ipynb to run part two of the tutorial.

Clean up resources

Do not complete this section if you plan on continuing to part 2 of the tutorial.

Stop the notebook VM

If you used a cloud notebook server, stop the VM when you are not using it to reduce cost.

  1. In your workspace, select Notebook VMs.

    Stop the VM server

  2. From the list, select the VM.

  3. Select Stop.

  4. When you're ready to use the server again, select Start.

Delete everything


The resources you created can be used as prerequisites to other Azure Machine Learning service tutorials and how-to articles.

If you don't plan to use the resources you created, delete them, so you don't incur any charges:

  1. In the Azure portal, select Resource groups on the far left.

    Delete in the Azure portal

  2. From the list, select the resource group you created.

  3. Select Delete resource group.

  4. Enter the resource group name. Then select Delete.

You can also keep the resource group but delete a single workspace. Display the workspace properties and select Delete.

Next steps

In this tutorial, you completed these tasks:

  • Created an Azure Machine Learning service workspace.
  • Created and configured a cloud notebook server in your workspace.

Continue with part 2 of this tutorial to train a simple machine learning model.