Skip to content

Commit 2512499

Browse files
committed
Edit content
1 parent dbfc4b7 commit 2512499

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

articles/machine-learning/how-to-safely-rollout-online-endpoints.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ ms.subservice: mlops
88
author: msakande
99
ms.author: mopeakande
1010
ms.reviewer: sehan
11-
ms.date: 10/24/2023
11+
ms.date: 02/18/2025
1212
ms.topic: how-to
1313
ms.custom: how-to, devplatv2, cliv2, sdkv2, update-code
1414
# customer intent: As a developer, I want to see how to use a blue-green deployment strategy in Azure Machine Learning so that I can roll out a new version of a machine learning model without causing disruption.
1515
---
1616

1717
# Perform safe rollout of new deployments for real-time inference
1818

19-
[!INCLUDE [dev v2](includes/machine-learning-dev-v2.md)]
19+
[!INCLUDE [Version 2 applies-to line](includes/machine-learning-dev-v2.md)]
2020

2121
In this article, you see how to deploy a new version of a machine learning model in production without causing any disruption. You use a blue-green deployment strategy, which is also known as a safe rollout strategy, to introduce a new version of a web service to production. When you use this strategy, you can roll out your new version of the web service to a small subset of users or requests before rolling it out completely.
2222

@@ -39,7 +39,7 @@ In this article, you see how to:
3939

4040
# [Azure CLI](#tab/azure-cli)
4141

42-
[!INCLUDE [basic prereqs cli](includes/machine-learning-cli-prereqs.md)]
42+
[!INCLUDE [Basic Azure CLI prerequisites](includes/machine-learning-cli-prereqs.md)]
4343

4444
* A user account that has at least one of the following Azure role-based access control (Azure RBAC) roles:
4545

@@ -53,9 +53,9 @@ In this article, you see how to:
5353

5454
# [Python SDK](#tab/python)
5555

56-
[!INCLUDE [sdk v2](includes/machine-learning-sdk-v2.md)]
56+
[!INCLUDE [Python SDK v2](includes/machine-learning-sdk-v2.md)]
5757

58-
[!INCLUDE [basic prereqs sdk](includes/machine-learning-sdk-v2-prereqs.md)]
58+
[!INCLUDE [Basic Python SDK prerequisites](includes/machine-learning-sdk-v2-prereqs.md)]
5959

6060
* A user account that has at least one of the following Azure role-based access control (Azure RBAC) roles:
6161

@@ -91,10 +91,10 @@ In this article, you see how to:
9191

9292
You can configure default values to use with the Azure CLI. To avoid passing in values for your subscription, workspace, and resource group multiple times, run the following code:
9393

94-
```azurecli
95-
az account set --subscription <subscription-ID>
96-
az configure --defaults workspace=<Azure-Machine-Learning-workspace-name> group=<resource-group-name>
97-
```
94+
```azurecli
95+
az account set --subscription <subscription-ID>
96+
az configure --defaults workspace=<Azure-Machine-Learning-workspace-name> group=<resource-group-name>
97+
```
9898

9999
### Clone the examples repository
100100

@@ -144,7 +144,7 @@ The [workspace](concept-workspace.md) is the top-level resource for Azure Machin
144144
> [!NOTE]
145145
> If you're using a Kubernetes online endpoint, import the `KubernetesOnlineEndpoint` and `KubernetesOnlineDeployment` class from the `azure.ai.ml.entities` library.
146146
147-
1. Configure workspace details and get a handle to the workspace:
147+
1. Configure workspace settings and get a handle to the workspace:
148148

149149
To connect to a workspace, you need identifier parameters—a subscription, a resource group, and a workspace name. You use this information in the `MLClient` class from the `azure.ai.ml` module to get a handle to the required Azure Machine Learning workspace. This example uses the [default Azure authentication](/python/api/azure-identity/azure.identity.defaultazurecredential).
150150

@@ -194,7 +194,7 @@ The following table lists key attributes to specify when you define an endpoint.
194194
| Traffic | Optional | Rules on how to route traffic across deployments. You represent the traffic as a dictionary of key-value pairs, where the key represents the deployment name and the value represents the percentage of traffic to that deployment. You can set the traffic only when the deployments under an endpoint have been created. You can also update the traffic for an online endpoint after the deployments have been created. For more information about how to use mirrored traffic, see [Allocate a small percentage of live traffic to the new deployment](#allocate-a-small-percentage-of-live-traffic-to-the-new-deployment). |
195195
| Mirror traffic | Optional | The percentage of live traffic to mirror to a deployment. For more information about how to use mirrored traffic, see [Test the deployment with mirrored traffic](#test-the-deployment-with-mirrored-traffic). |
196196

197-
To see a full list of attributes that you can specify when you create an endpoint, see [CLI (v2) online endpoint YAML schema](/azure/machine-learning/reference-yaml-endpoint-online) or for version 2 of the Azure Machine Learning SDK for Python, see [ManagedOnlineEndpoint Class](/python/api/azure-ai-ml/azure.ai.ml.entities.managedonlineendpoint).
197+
To see a full list of attributes that you can specify when you create an endpoint, see [CLI (v2) online endpoint YAML schema](/azure/machine-learning/reference-yaml-endpoint-online). For version 2 of the Azure Machine Learning SDK for Python, see [ManagedOnlineEndpoint Class](/python/api/azure-ai-ml/azure.ai.ml.entities.managedonlineendpoint).
198198

199199
### Define a deployment
200200

@@ -221,7 +221,7 @@ You first set the endpoint name and then configure it. In this article, you use
221221

222222
:::code language="yaml" source="~/azureml-examples-main/cli/endpoints/online/managed/sample/endpoint.yml":::
223223

224-
The following table describes keys that the endpoint YAML format uses. To learn how to specify these attributes, see [CLI (v2) online endpoint YAML schema](reference-yaml-endpoint-online.md). For information about limits related to managed online endpoints, see [Azure Machine Learning online endpoints and batch endpoints](how-to-manage-quotas.md#azure-machine-learning-online-endpoints-and-batch-endpoints).
224+
The following table describes keys that the endpoint YAML format uses. To see how to specify these attributes, see [CLI (v2) online endpoint YAML schema](reference-yaml-endpoint-online.md). For information about limits related to managed online endpoints, see [Azure Machine Learning online endpoints and batch endpoints](how-to-manage-quotas.md#azure-machine-learning-online-endpoints-and-batch-endpoints).
225225

226226
| Key | Description |
227227
| --- | --- |
@@ -242,7 +242,7 @@ To create an online endpoint:
242242
243243
1. Create the endpoint in the cloud:
244244

245-
Run the following code to use the `endpoint.yml` file to configure the endpoint:
245+
Run the following code to use the endpoint.yml file to configure the endpoint:
246246

247247
:::code language="azurecli" source="~/azureml-examples-main/cli/deploy-safe-rollout-online-endpoints.sh" ID="create_endpoint":::
248248

@@ -261,7 +261,7 @@ To use the blue-deployment.yml file to create the `blue` deployment for your end
261261
262262
In the blue-deployment.yaml file, the `path` line specifies where to upload files from. The Azure Machine Learning CLI uses this information to upload the files and register the model and environment. As a best practice for production, you should register the model and environment and specify the registered name and version separately in the YAML code. Use the format `model: azureml:<model-name>:<model-version>` for the model, for example, `model: azureml:my-model:1`. For the environment, use the format `environment: azureml:<environment-name>:<environment-version>`, for example, `environment: azureml:my-env:1`.
263263

264-
For registration, you can extract the YAML definitions of `model` and `environment` into separate YAML files and use the commands `az ml model create` and `az ml environment create`. To learn more about these commands, run `az ml model create -h` and `az ml environment create -h`.
264+
For registration, you can extract the YAML definitions of `model` and `environment` into separate YAML files and use the commands `az ml model create` and `az ml environment create`. To find out more about these commands, run `az ml model create -h` and `az ml environment create -h`.
265265

266266
For more information about registering your model as an asset, see [Register a model by using the Azure CLI or Python SDK](how-to-manage-models.md#register-a-model-by-using-the-azure-cli-or-python-sdk). For more information about creating an environment, see [Create a custom environment](how-to-manage-environments-v2.md#create-a-custom-environment).
267267

@@ -380,8 +380,8 @@ One way to create a managed online endpoint in the studio is from the **Models**
380380
1. On the **Deployment** page, take the following steps:
381381
1. Under **Deployment name**, enter **blue**.
382382
1. If you want to view graphs of your endpoint activities in the studio later:
383-
1. Under **Inferencing data collection**, turn on the toggle.
384-
1. Under **Application Insights diagnostics**, turn on the toggle.
383+
1. Under **Inferencing data collection**, turn on the toggle.
384+
1. Under **Application Insights diagnostics**, turn on the toggle.
385385
1. Select **Next**.
386386

387387
1. On the **Code and environment for inferencing** page, take the following steps:
@@ -483,7 +483,7 @@ You can view all your managed online endpoints in the studio endpoints page. The
483483

484484
1. In the studio, select **Endpoints**. A list of all the endpoints in the workspace is displayed.
485485

486-
1. Optionally, create a filter on the compute type to show only managed compute types.
486+
1. Optionally, create a filter on the compute instance type to show only managed types.
487487

488488
1. Select an endpoint name to view the endpoint's **Details** page.
489489

@@ -550,7 +550,7 @@ Create a new deployment named `green`:
550550

551551
:::code language="azurecli" source="~/azureml-examples-main/cli/deploy-safe-rollout-online-endpoints.sh" ID="create_green" :::
552552

553-
Because you haven't explicitly allocated any traffic to the `green` deployment, it has zero traffic allocated to it. You can verify that fact by using the following command:
553+
Because you don't explicitly allocate any traffic to the `green` deployment, it has zero traffic allocated to it. You can verify that fact by using the following command:
554554

555555
:::code language="azurecli" source="~/azureml-examples-main/cli/deploy-safe-rollout-online-endpoints.sh" ID="get_traffic" :::
556556

@@ -638,7 +638,7 @@ Alternatively, you can use the **Models** page to add a deployment:
638638
1. To finish creating the `green` deployment, follow steps 4 through 6 in the [Configure initial settings](#configure-initial-settings) section and all the steps in the [Configure remaining settings and create the deployment](#configure-remaining-settings-and-create-the-deployment) section.
639639

640640
> [!NOTE]
641-
> When you add a new deployment to an endpoint, you can use the **Update traffic allocation** page to adjust the traffic balance between the deployments. But to follow the rest of the procedures in this article, keep the default traffic allocation of 100 percent to the `blue` deployment and 0 percent to the `green` deployment.
641+
> When you add a new deployment to an endpoint, you can use the **Update traffic allocation** page to adjust the traffic balance between the deployments. But to follow the rest of the procedures in this article, keep the default traffic allocation of 100 percent to the `blue` deployment for now and 0 percent to the `green` deployment.
642642
643643
### Test the new deployment
644644

@@ -693,7 +693,7 @@ for i in {1..20} ; do
693693
done
694694
```
695695

696-
You can confirm that the specified percentage of the traffic was sent to the `green` deployment by checking the logs from the deployment:
696+
You can confirm that the specified percentage of the traffic is sent to the `green` deployment by checking the logs from the deployment:
697697

698698
```azurecli
699699
az ml online-deployment get-logs --name green --endpoint $ENDPOINT_NAME
@@ -712,7 +712,7 @@ Use the following code to mirror 10 percent of the traffic and send it to the `g
712712
You can test mirror traffic by invoking the endpoint several times without specifying a deployment to receive the incoming traffic:
713713
[!notebook-python[](~/azureml-examples-main/sdk/python/endpoints/online/managed/online-endpoints-safe-rollout.ipynb?name=several_tests_to_mirror_traffic)]
714714

715-
You can confirm that the specified percentage of the traffic was sent to the `green` deployment by checking the logs from the deployment:
715+
You can confirm that the specified percentage of the traffic is sent to the `green` deployment by checking the logs from the deployment:
716716

717717
```python
718718
ml_client.online_deployments.get_logs(
@@ -744,9 +744,9 @@ The endpoint details page now shows a mirrored traffic allocation of 10 percent
744744

745745
:::image type="content" source="media/how-to-safely-rollout-managed-endpoints/endpoint-details-showing-mirrored-traffic-allocation.png" alt-text="Screenshot of the Details tab of an endpoint page. In the mirrored traffic allocation, the green deployment percentage is 10 percent of traffic." lightbox="media/how-to-safely-rollout-managed-endpoints/endpoint-details-showing-mirrored-traffic-allocation.png":::
746746

747-
To test mirrored traffic, see the Azure CLI or Python tabs to invoke the endpoint several times. Confirm that the specified percentage of traffic was sent to the `green` deployment by checking the logs from the deployment. You can access the deployment logs on the endpoint page by going to the **Logs** tab.
747+
To test mirrored traffic, see the Azure CLI or Python tabs to invoke the endpoint several times. Confirm that the specified percentage of traffic is sent to the `green` deployment by checking the logs from the deployment. You can access the deployment logs on the endpoint page by going to the **Logs** tab.
748748

749-
You can also use metrics and logs to monitor performance of the mirrored traffic. For more information, see [Monitor online endpoints](how-to-monitor-online-endpoints.md).
749+
You can also use metrics and logs to monitor the performance of the mirrored traffic. For more information, see [Monitor online endpoints](how-to-monitor-online-endpoints.md).
750750

751751
After testing, you can disable mirroring by taking the following steps:
752752

0 commit comments

Comments
 (0)