You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/machine-learning/service/how-to-deploy-and-where.md
+35-34Lines changed: 35 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -215,7 +215,7 @@ The following table provides an example of creating a deployment configuration f
215
215
216
216
The following sections demonstrate how to create the deployment configuration, and then use it to deploy the web service.
217
217
218
-
## Where to deploy
218
+
## Deploy to target
219
219
220
220
### <aid="local"></a> Deploy locally
221
221
@@ -267,19 +267,13 @@ For more information, see the reference documentation for the [AciWebservice](ht
267
267
268
268
You can use an existing AKS cluster or create a new one using the Azure Machine Learning SDK, CLI, or the Azure portal.
269
269
270
+
<aid="deploy-aks"></a>
270
271
271
-
> [!IMPORTANT]
272
-
> Creating an AKS cluster is a one time process for your workspace. You can reuse this cluster for multiple deployments.
273
-
> If you have NOT created or attached an AKS cluster go <ahref="#create-attach-aks">here</a>.
272
+
If you already have an AKS cluster attached, you can deploy to it. If you have NOT created or attached an AKS cluster go <ahref="#create-attach-aks">here</a>.
274
273
275
-
#### Deploy to AKS <aid="deploy-aks"></a>
276
274
277
-
You can deploy to AKS with the Azure ML CLI:
278
-
```azurecli-interactive
279
-
az ml model deploy -ct myaks -m mymodel:1 -n aksservice -ic inferenceconfig.json -dc deploymentconfig.json
For more information on configuring your AKS deployment, including autoscale, see the [AksWebservice.deploy_configuration](https://docs.microsoft.com/python/api/azureml-core/azureml.core.webservice.akswebservice) reference.
286
+
Learn more about AKS deployment and autoscale in the [AksWebservice.deploy_configuration](https://docs.microsoft.com/python/api/azureml-core/azureml.core.webservice.akswebservice) reference.
293
287
294
-
**Time estimate:** Approximately 5 minutes.
288
+
**Using the CLI**
289
+
290
+
```azurecli-interactive
291
+
az ml model deploy -ct myaks -m mymodel:1 -n aksservice -ic inferenceconfig.json -dc deploymentconfig.json
292
+
```
295
293
296
-
#### Create or attach an AKS cluster <aid="create-attach-aks"></a>
297
-
Creating or attaching an AKS cluster is a **one time process** for your workspace.
298
-
After a cluster has been associated with your workspace, you can use it for multiple deployments.
294
+
#### Create a new AKS cluster<aid="create-attach-aks"></a>
295
+
**Time estimate:** Approximately 5 minutes.
299
296
300
-
If you delete the cluster or the resource group that contains it, you must create a new cluster the next time you need to deploy.
297
+
> [!IMPORTANT]
298
+
> Creating or attaching an AKS cluster is a one time process for your workspace. You can reuse this cluster for multiple deployments. If you delete the cluster or the resource group that contains it, you must create a new cluster the next time you need to deploy.
301
299
302
-
##### Create a new AKS cluster
303
300
For more information on setting `autoscale_target_utilization`, `autoscale_max_replicas`, and `autoscale_min_replicas`, see the [AksWebservice.deploy_configuration](https://docs.microsoft.com/python/api/azureml-core/azureml.core.webservice.akswebservice?view=azure-ml-py#deploy-configuration-autoscale-enabled-none--autoscale-min-replicas-none--autoscale-max-replicas-none--autoscale-refresh-seconds-none--autoscale-target-utilization-none--collect-model-data-none--auth-enabled-none--cpu-cores-none--memory-gb-none--enable-app-insights-none--scoring-timeout-ms-none--replica-max-concurrent-requests-none--max-request-wait-time-none--num-replicas-none--primary-key-none--secondary-key-none--tags-none--properties-none--description-none-) reference.
304
301
The following example demonstrates how to create a new Azure Kubernetes Service cluster:
305
302
@@ -329,7 +326,7 @@ For more information on creating an AKS cluster outside of the Azure Machine Lea
329
326
330
327
**Time estimate**: Approximately 20 minutes.
331
328
332
-
#####Attach an existing AKS cluster
329
+
#### Attach an existing AKS cluster
333
330
334
331
If you already have AKS cluster in your Azure subscription, and it is version 1.12.## and has at least 12 virtual CPUs, you can use it to deploy your image. The following code demonstrates how to attach an existing AKS 1.12.## cluster to your workspace:
335
332
@@ -374,7 +371,18 @@ print(response.json())
374
371
375
372
For more information, see [Create client applications to consume webservices](how-to-consume-web-service.md).
376
373
377
-
## <aid="update"></a> Update the web service
374
+
## More inference options
375
+
376
+
### <aid="azuremlcompute"></a> Batch inference
377
+
Azure Machine Learning Compute targets are created and managed by the Azure Machine Learning service. They can be used for batch prediction from Azure Machine Learning Pipelines.
378
+
379
+
For a walkthrough of batch inference with Azure Machine Learning Compute, read the [How to Run Batch Predictions](how-to-run-batch-predictions.md) article.
380
+
381
+
### <aid="iotedge"></a> Inference on IoT Edge
382
+
Support for deploying to the edge is in preview. For more information, see the [Deploy Azure Machine Learning as an IoT Edge module](https://docs.microsoft.com/azure/iot-edge/tutorial-deploy-machine-learning) article.
383
+
384
+
385
+
## <aid="update"></a> Update web services
378
386
379
387
When you create a new model, you must manually update each service that you want to use the new model. To update the web service, use the `update` method. The following code demonstrates how to update the web service to use a new model:
380
388
@@ -399,15 +407,11 @@ print(service.state)
399
407
print(service.get_logs())
400
408
```
401
409
402
-
## Clean up
403
-
To delete a deployed web service, use `service.delete()`.
404
-
To delete a registered model, use `model.delete()`.
405
-
406
-
For more information, see the reference documentation for [WebService.delete()](https://docs.microsoft.com/python/api/azureml-core/azureml.core.webservice(class)?view=azure-ml-py#delete--), and [Model.delete()](https://docs.microsoft.com/python/api/azureml-core/azureml.core.model.model?view=azure-ml-py#delete--).
### <aid="customimage"></a> Use a custom base image
414
+
**<aid="customimage"></a> Use a custom base image**
411
415
412
416
Internally, InferenceConfig creates a Docker image that contains the model and other assets needed by the service. If not specified, a default base image is used.
413
417
@@ -451,19 +455,16 @@ If your model is trained on Azure Machine Learning Compute, using __version 1.0.
Azure Machine Learning Compute targets are created and managed by the Azure Machine Learning service. They can be used for batch prediction from Azure Machine Learning Pipelines.
458
-
459
-
For a walkthrough of batch inference with Azure Machine Learning Compute, read the [How to Run Batch Predictions](how-to-run-batch-predictions.md) article.
458
+
## Clean up resources
459
+
To delete a deployed web service, use `service.delete()`.
460
+
To delete a registered model, use `model.delete()`.
460
461
461
-
## <aid="iotedge"></a> Inference on IoT Edge
462
-
Support for deploying to the edge is in preview. For more information, see the [Deploy Azure Machine Learning as an IoT Edge module](https://docs.microsoft.com/azure/iot-edge/tutorial-deploy-machine-learning) article.
462
+
For more information, see the reference documentation for [WebService.delete()](https://docs.microsoft.com/python/api/azureml-core/azureml.core.webservice(class)?view=azure-ml-py#delete--), and [Model.delete()](https://docs.microsoft.com/python/api/azureml-core/azureml.core.model.model?view=azure-ml-py#delete--).
0 commit comments