# Azure ML Lesson 2

## How to install all the tools in a nutshell.

A host running **Ubuntu 22.04** is expected. If you have a Windows system or Mac, download Virtualbox and setup a VM or WSL2 with Ubuntu 22.04.

**Anaconda/Miniconda** must be installed. See [here](https://docs.docker.com/desktop/install/windows-install/) and [here](https://docs.conda.io/projects/conda/en/latest/user-guide/install/linux.html), respectively.

Run the following commands to install Azure CLI:

```bash
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
```

Configure the Azure CLI

```bash
az login
```

Install Azure ML CLI

```bash
az extension add -n ml -y
```

Create a Conda environment to work with Azure in. At this moment, there are [problems with Python 3.9](https://github.com/Azure/MachineLearningNotebooks/issues/1285), so use Python 3.12.

```bash
conda create --name azure_ml -y python=3.12 pip
conda activate azure_ml

# Install linting, formatting and additional libraries
pip install flake8 black isort joblib azure-ai-ml azure-identity
```

You now have a Conda environment called `azure_ml` containing the AzureML SDK.

Install Visual Studio Code as shown [here](https://code.visualstudio.com/download).

Once you've installed VS Code, configure its plugins and tell it to use the
Python interpreter with the `azure_ml` environment.

- Run VS Code and install vscode-icons, python, Code Spell Checker and Azure Machine Learning extensions
- Go into Azure Machine Learning and log in. Check that you have access to your workspace.
- Install Flake8, Black formatter and isort Microsoft extensions.
- Select a Python interpreter
  - Python is an interpreted language, and in order to run Python code and get Python IntelliSense, you must tell VS Code which interpreter to use.
  - From within VS Code, select a Python 3 interpreter by opening the Command
    Palette (Ctrl+Shift+P) and searching for: `Python: Select Interpreter`...
  - ... then select the environment named `azure_ml`.
