How to deploy an AutoML model to an online endpoint

APPLIES TO: Azure CLI ml extension v2 (current) Python SDK azure-ai-ml v2 (current)

In this article, you learn how to deploy an AutoML-trained machine learning model to an online real-time inference endpoint. Automated machine learning, also referred to as automated ML or AutoML, is the process of automating the time-consuming, iterative tasks of developing a machine learning model. For more information, see What is automated machine learning (AutoML)?

In the following sections, you learn how to deploy AutoML trained machine learning model to online endpoints using:

  • Azure Machine Learning studio
  • Azure Machine Learning CLI v2
  • Azure Machine Learning Python SDK v2

Prerequisites

Deploy from Azure Machine Learning studio and no code

Deploying an AutoML-trained model from the Automated ML page is a no-code experience. That is, you don't need to prepare a scoring script and environment because both are autogenerated.

  1. In Azure Machine Learning studio, go to the Automated ML page.

  2. Select your experiment and run it.

  3. Choose the Models + child jobs tab.

  4. Select the model that you want to deploy.

  5. After you select a model, the Deploy button is available with a dropdown menu.

  6. Select Real-time endpoint option.

    Screenshot showing the Deploy button's drop-down menu.

    The system generates the Model and Environment needed for the deployment.

    Screenshot showing the deployment page where you can change values and then select Deploy.

Deploy manually from the studio or command line

If you want to have more control over the deployment, you can download the training artifacts and deploy them.

To download the components, you need for deployment:

  1. Go to your Automated ML experiment and run it in your machine learning workspace.

  2. Choose the Models + child jobs tab.

  3. Select the model you want to use. After you select a model, the Download button is enabled.

  4. Choose Download.

    Screenshot showing the selection of the model and download button.

You receive a .zip file that contains:

  • A conda environment specification file named conda_env_<VERSION>.yml
  • A Python scoring file named scoring_file_<VERSION>.py
  • The model itself, in a Python .pkl file named model.pkl

To deploy using these files, you can use either the studio or the Azure CLI.

  1. In Azure Machine Learning studio, go to the Models page.
  2. Select Select + Register > From local files.
  3. Register the model you downloaded from Automated ML run.
  4. Go to the Environments page, select Custom environment, and select + Create to create an environment for your deployment. Use the downloaded conda yaml to create a custom environment.
  5. Select the model, and from the Deploy dropdown menu, select Real-time endpoint.
  6. Complete all the steps in wizard to create an online endpoint and deployment.