Create an Azure Machine Learning workspace

In this article, you learn how to create an Azure Machine Learning workspace, which is the top-level resource for Azure Machine Learning. It provides a centralized place to work with all the artifacts you create when you use Azure Machine Learning. The workspace contains algorithms and compute that let you train and then track your machine learning experiments. It also contains resources for you to use when you deploy your models and review their metrics.

Note: To create a workspace, you need an Azure subscription. If you don't have one, create a free account before you begin.

What is an Azure Machine Learning workspace?

An Azure Machine Learning workspace is a resource in Azure that provides a centralized place to work with all of your artifacts that you create when you use Azure Machine Learning. These artifacts include:

  • Experiments: A collection of runs.
  • Runs: A single execution of a script or process that produces metrics, parameters, and outputs.
  • Models: Trained machine learning models.
  • Endpoints: Deployed models accessible via a REST API.
  • Datastores: References to data storage services in Azure.
  • Datasets: References to data stored in datastores.
  • Compute targets: Virtual machines, compute clusters, and AKS clusters used for training and inference.

Prerequisites

Before you create a workspace, make sure you have the following:

  • An Azure subscription. If you don't have one, create a free account.
  • Permissions to create resources in your Azure subscription. For example, the Contributor or Owner role.

Create a workspace

You can create an Azure Machine Learning workspace using the Azure portal, Azure CLI, or SDKs.

Using the Azure portal

  1. Sign in to the Azure portal.

    Go to https://portal.azure.com/ and sign in with your Azure account credentials.

  2. Search for "Azure Machine Learning".

    In the Azure portal search bar, type "Azure Machine Learning" and select it from the results.

    Placeholder for Azure Machine Learning search result
  3. Click "Create".

    On the Azure Machine Learning page, click the Create button.

  4. Configure the workspace.

    Fill in the following details:

    • Subscription: Select your Azure subscription.
    • Resource group: Select an existing resource group or create a new one.
    • Workspace name: Enter a unique name for your workspace.
    • Region: Select the Azure region where you want to create the workspace.
    • Storage account: Select an existing storage account or let Azure create a new one for you.
    • Key vault: Select an existing key vault or let Azure create a new one for you.
    • Application Insights: Select an existing Application Insights instance or let Azure create a new one for you.
    • Tags (Optional): Add tags to categorize your resources.
    Placeholder for Azure ML workspace creation form
  5. Review and create.

    Click the Review + create button, and then click Create.

Using the Azure CLI

You can also create a workspace using the Azure CLI with the following command:

az ml workspace create -n  -g  -l 

Replace the placeholders with your desired values:

  • <workspace_name>: The name for your workspace.
  • <resource_group_name>: The name of your resource group.
  • <location>: The Azure region for your workspace (e.g., "eastus").

For example:

az ml workspace create -n my-ml-workspace -g my-resource-group -l eastus

Using the Python SDK

You can create a workspace using the Azure Machine Learning Python SDK:

from azureml.core import Workspace

workspace = Workspace.create(name = "my-ml-workspace",
                           subscription_id = "",
                           resource_group = "my-resource-group",
                           location = "eastus")

Replace <your-subscription-id> with your actual Azure subscription ID.

Next steps

Once your workspace is created, you can start using it to: