Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Score Azure ML Managed Online Endpoint

This notebook demonstrates testing the Azure Machine Learning (Azure ML) models that have been deployed to Azure ML managed online endpoints.

Prerequisites

Before proceeding with this notebook, ensure the following prerequisites are met:

  1. Azure ML Model Deployment: Your Azure ML model must be deployed to an Azure ML managed online endpoint. If your model is not yet deployed, please follow the instructions in the deployment notebook.

  2. Execute the az login command to sign in to your Azure subscription. For detailed instructions, refer to the “Authenticate with Azure Subscription” section here

Environment Variables

Below are the environment variables that needs to be set in .env file:

  1. AZURE_ML_SCORE_DEPLOYMENT_NAME

    • This deployment name can be acquired from the Azure ML managed online endpoint, as illustrated in image below.
      AML Deployment Name

  2. AZURE_ML_MANAGED_ENDPOINT

    • To obtain the managed endpoint, navigate through the Azure ML workspace by selecting ‘Launch Studio’, then ‘Endpoints’ on the left side, followed by ‘Consume’. Copy the REST endpoint as depicted below.
      AML Score URI

  3. AZURE_ML_KEY

    • Navigate through the Azure ML workspace by selecting ‘Launch Studio’, then ‘Endpoints’ on the left side, followed by ‘Consume’. The primary key can be obtained as shown in the subsequent image.
      AML Score Key

Azure ML endpoint JSON body

The JSON body can be acquired by the following method: Access the Hugging Face model within the Azure ML model catalog by going to the workspace, then to the studio, selecting ‘Model Catalog’, and using the search bar to find the model ID. Open the model to view the sample input schema as shown in the image below.
aml_model_endpoint_schema.png

In addition, we have compiled the details of the request and response for the Hugging Face models hosted on the Azure Machine Learning (Azure ML) endpoint. Please review the provided link to access the JSON request body and response for the Azure ML endpoint. Additionally, you can deduce the schema from the response if a bad request was sent to the inference endpoint.

{"output":"Could you please pass me the Wi-Fi password for this network? I need it to connect my device. <|done|>"}