@@ -467,6 +467,12 @@ Let's imagine that there is a new version of the model created by the developmen
467
467
az ml model create --name $MODEL_NAME --type "mlflow_model" --path "model"
468
468
```
469
469
470
+ Let's get the version number of the new model:
471
+
472
+ ```azurecli
473
+ VERSION=$(az ml model show -n heart-classifier --label latest | jq -r ".version")
474
+ ```
475
+
470
476
# [Python (Azure ML SDK)](#tab/sdk)
471
477
472
478
```python
@@ -476,6 +482,7 @@ Let's imagine that there is a new version of the model created by the developmen
476
482
model = ml_client.models.create_or_update(
477
483
Model(name=model_name, path=model_local_path, type=AssetTypes.MLFLOW_MODEL)
478
484
)
485
+ version = model.version
479
486
```
480
487
481
488
# [Python (MLflow SDK)](#tab/mlflow)
@@ -498,13 +505,19 @@ Let's imagine that there is a new version of the model created by the developmen
498
505
499
506
```yml
500
507
$schema: https://azuremlschemas.azureedge.net/latest/managedOnlineDeployment.schema.json
501
- name: xgboost-model-new
508
+ name: xgboost-model
502
509
endpoint_name: heart-classifier-edp
503
510
model: azureml:heart-classifier@latest
504
511
instance_type: Standard_DS2_v2
505
512
instance_count: 1
506
513
```
507
514
515
+ We will name the deployment as follows:
516
+
517
+ ```azurecli
518
+ GREEN_DEPLOYMENT_NAME="xgboost-model-$VERSION"
519
+ ```
520
+
508
521
# [Python (Azure ML SDK)](#tab/sdk)
509
522
510
523
```python
@@ -554,7 +567,7 @@ Let's imagine that there is a new version of the model created by the developmen
554
567
# [Azure CLI](#tab/cli)
555
568
556
569
```azurecli
557
- az ml online-deployment create --endpoint-name $ENDPOINT_NAME -f green-deployment.yml
570
+ az ml online-deployment create -n $GREEN_DEPLOYMENT_NAME - -endpoint-name $ENDPOINT_NAME -f green-deployment.yml
558
571
```
559
572
560
573
# [Python (Azure ML SDK)](#tab/sdk)
@@ -611,7 +624,7 @@ One we are confident with the new deployment, we can update the traffic to route
611
624
# [Azure CLI](#tab/cli)
612
625
613
626
```azurecli
614
- az ml online-endpoint update --name $ENDPOINT_NAME --traffic "default=90 xgboost-model-new =10"
627
+ az ml online-endpoint update --name $ENDPOINT_NAME --traffic "default=90 $GREEN_DEPLOYMENT_NAME =10"
615
628
```
616
629
617
630
# [Python (Azure ML SDK)](#tab/sdk)
@@ -662,7 +675,7 @@ One we are confident with the new deployment, we can update the traffic to route
662
675
# [Azure CLI](#tab/cli)
663
676
664
677
```azurecli
665
- az ml online-endpoint update --name $ENDPOINT_NAME --traffic "default=0 xgboost-model-new =100"
678
+ az ml online-endpoint update --name $ENDPOINT_NAME --traffic "default=0 $GREEN_DEPLOYMENT_NAME =100"
666
679
```
667
680
668
681
# [Python (Azure ML SDK)](#tab/sdk)
0 commit comments