Quickstart: Use a cloud-based notebook server to get started with Azure Machine Learning

No install required. Get started with Azure Machine Learning service using a managed notebook server in the cloud. If you want to instead install the SDK into your own Python environment, see Quickstart: Use your own notebook server to get started with Azure Machine Learning.

This quickstart shows how you can use the Azure Machine Learning service workspace to keep track of your machine learning experiments. You will create a notebook VM (Preview), a secure, cloud-based Azure workstation that provides a Jupyter notebook server, JupyterLab, and a fully prepared ML environment. You then run a Python notebook on this VM that log values into the workspace.

In this quickstart, you take the following actions:

  • Create a workspace
  • Create a notebook VM in your workspace.
  • Launch the Jupyter web interface.
  • Open a notebook that contains code to estimate pi and logs errors at each iteration.
  • Run the notebook.
  • View the logged error values in your workspace. This example shows how the workspace can help you keep track of information generated in a script.

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

If you 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.

    Azure portal

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

    Create a resource in Azure portal

  3. In the search bar, enter Machine Learning. Select the Machine Learning service workspace search result.

    Search for a workspace

  4. In the ML service workspace pane, scroll to the bottom and select Create to begin.

    Create

  5. In the ML service workspace pane, configure your workspace.

    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 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 is a container that 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. This location is where the workspace is created.

    Create workspace

  6. To start the creation process, select Create. It can take a few moments to create the workspace.

  7. To check on the status of the deployment, select the Notifications icon, bell, on the toolbar.

  8. When the process is finished, a deployment success message appears. It's also present in the notifications section. To view the new workspace, select Go to resource.

    Workspace creation status

Create a notebook VM

From your workspace, you create a cloud resource to get started using Jupyter notebooks. This resource gives you a cloud-based platform 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.

    Note

    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.

    Create a new VM

  5. Wait approximately 4-5 minutes, 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.

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

  3. The samples foldername includes a version number, for example samples-1.0.33.1. Select the samples folder.

  4. Select the quickstart notebook.

Run the notebook

Run a notebook that estimates pi and logs the error to your workspace.

  1. Select 01.run-experiment.ipynb to open the notebook.

  2. Click into the first code cell and select Run.

    Note

    Code cells have brackets before them. If the brackets are empty ([ ]), the code has not been run. While the code is running, you see an asterisk([*]). After the code completes, a number [1] appears. The number tells you the order in which the cells ran.

    Use Shift-Enter as a shortcut to run a cell.

    Run the first code cell

  3. Run the second code cell. If you see instructions to authenticate, copy the code and follow the link to sign in. Once you sign in, your browser will remember this setting.

    Authenticate

  4. When complete, the cell number [2] appears. If you had to sign in, you will see a successful authentication status message. If you didn't have to sign in, you won't see any output for this cell, only the number appears to show that the cell ran successfully.

    Success message

  5. Run the rest of the code cells. As each cell finishes running, you will see its cell number appear. Only the last cell displays any other output.

    In the largest code cell, you see run.log used in multiple places. Each run.log adds its value to your workspace.

View logged values

  1. The output from the run cell contains a link back to the Azure portal to view the experiment results in your workspace.

    View experiments

  2. Click the Link to Azure portal to view information about the run in your workspace. This link opens your workspace in the Azure portal.

  3. The plots of logged values you see were automatically created in the workspace. Whenever you log multiple values with the same name parameter, a plot is automatically generated for you.

    View history

Because the code to approximate pi uses random values, your plots will show different values.

Clean up resources

Stop the notebook VM

Stop the notebook 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

Important

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 quickstart, you completed these tasks:

  • Create a workspace
  • Create a notebook VM.
  • Launch the Jupyter web interface.
  • Open a notebook that contains code to estimate pi and logs errors at each iteration.
  • Run the notebook.
  • View the logged error values in your workspace. This example shows how the workspace can help you keep track of information generated in a script.

On the Jupyter Notebook webpage, browse through other notebooks in the samples folder to learn more about Azure Machine Learning service.

For an in-depth workflow experience, follow Machine Learning tutorials to train and deploy a model: