🖍️
Developers Guide to Azure AI
  • Introduction
  • Pre-Requirements
    • Azure Passes
    • Azure CLI
  • Azure Machine Learning
    • Lab 1 - Environment Setup
    • Lab 2 - Train your model
    • Lab 3 - Deploy your model
  • Cognitive Services
    • Lab 1 - Computer Vision
    • Lab 2 - Custom Vision
  • Resources
    • Slides
    • PyTorch Fundamentals
    • Microsoft Learn
Powered by GitBook
On this page
  • Create a Azure Machine Learning Workspace
  • Install the Azure Machine Learning CLI extension
  • Create a resource group
  • Create the workspace
  • Create a Compute Cluster
  • Create a Compute instance
  • Create a Notebook
  • Setup completed

Was this helpful?

  1. Azure Machine Learning

Lab 1 - Environment Setup

PreviousAzure CLINextLab 2 - Train your model

Last updated 3 years ago

Was this helpful?

Create a Azure Machine Learning Workspace

To get started we need to setup a few resources in Azure. For this we are going to use the Azure CLI. If you don’t have the installed on your machine you can follow the here.

Install the Azure Machine Learning CLI extension

To install the machine learning extension, use the following command:

az extension add -n azure-cli-ml

Create a resource group

The Azure Machine Learning workspace must be created inside a resource group. You can use an existing resource group or create a new one. To create a new resource group, use the following command. Replace with the name to use for this resource group. Replace with the Azure region to use for this resource group:

Example name and location:

  • resource group name: pytorchworkshop

  • location: WestEurope

az group create --name <resource-group-name> --location <location>

Create the workspace

To create a new workspace where the services are automatically created, use the following command:

az ml workspace create -w <workspace-name> -g <resource-group-name>

You can now view your workspace by visiting

Create a Compute Cluster

To train our model we need an Azure Machine Learning Compute cluster. To create a new compute cluster, use the following command.

This command will create an Azure Machine Learning Compute cluster with 1 node that is always on and is using STANDARD_NC6 virtual Machines.

To speed up the training process you can use a GPU enabled NC6 machine

az ml computetarget create amlcompute -n gpu-cluster --min-nodes 1 --max-nodes 1 --vm-size STANDARD_NC6 -w <workspace-name> -g <resource-group-name>

Creating compute can take a few minutes to complete

Create a Compute instance

To train our model we are going to use a notebook. To run a notebook in Azure Machine Learning studio we need to create a Compute Instance.

Choose a unique name

az ml computetarget create computeinstance -n <name> --vm-size Standard_D2_V2 -w <workspace-name> -g <resource-group-name>

Creating compute can take a few minutes to complete

Create a Notebook

  • Navigate to the Notebook section in Azure Machine Learning Workspace.

  • Create a new file with name 'simpsons' and File type 'notebook'

Setup completed

If everything went correctly you should be looking at a screen that looks like the one below and see that your notebook is running on your created Compute Instance.

View your created Azure Machine Learning Compute cluster on

View your created Azure Machine Learning Compute cluster on

Azure CLI
tutorial on MS Docs
https://ml.azure.com
https://ml.azure.com
https://ml.azure.com
Continue with lab 2 >
Azure Machine Learning studio
Create Azure Machine Learning Compute
Create Azure Machine Learning Compute Instance
Create new folder
Create new folder