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
@@ -216,7 +216,7 @@ The following table provides an example of creating a deployment configuration f
216
216
217
217
The following sections demonstrate how to create the deployment configuration, and then use it to deploy the web service.
218
218
219
-
## Where to deploy
219
+
## Deploy to target
220
220
221
221
### <aid="local"></a> Deploy locally
222
222
@@ -268,19 +268,13 @@ For more information, see the reference documentation for the [AciWebservice](ht
268
268
269
269
You can use an existing AKS cluster or create a new one using the Azure Machine Learning SDK, CLI, or the Azure portal.
270
270
271
+
<aid="deploy-aks"></a>
271
272
272
-
> [!IMPORTANT]
273
-
> Creating an AKS cluster is a one time process for your workspace. You can reuse this cluster for multiple deployments.
274
-
> If you have NOT created or attached an AKS cluster go <ahref="#create-attach-aks">here</a>.
273
+
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>.
275
274
276
-
#### Deploy to AKS <aid="deploy-aks"></a>
277
275
278
-
You can deploy to AKS with the Azure ML CLI:
279
-
```azurecli-interactive
280
-
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.
287
+
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.
294
288
295
-
**Time estimate:** Approximately 5 minutes.
289
+
**Using the CLI**
290
+
291
+
```azurecli-interactive
292
+
az ml model deploy -ct myaks -m mymodel:1 -n aksservice -ic inferenceconfig.json -dc deploymentconfig.json
293
+
```
296
294
297
-
#### Create or attach an AKS cluster <aid="create-attach-aks"></a>
298
-
Creating or attaching an AKS cluster is a **one time process** for your workspace.
299
-
After a cluster has been associated with your workspace, you can use it for multiple deployments.
295
+
#### Create a new AKS cluster<aid="create-attach-aks"></a>
296
+
**Time estimate:** Approximately 5 minutes.
300
297
301
-
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.
298
+
> [!IMPORTANT]
299
+
> 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.
302
300
303
-
##### Create a new AKS cluster
304
301
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.
305
302
The following example demonstrates how to create a new Azure Kubernetes Service cluster:
306
303
@@ -330,7 +327,7 @@ For more information on creating an AKS cluster outside of the Azure Machine Lea
330
327
331
328
**Time estimate**: Approximately 20 minutes.
332
329
333
-
#####Attach an existing AKS cluster
330
+
#### Attach an existing AKS cluster
334
331
335
332
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:
336
333
@@ -375,7 +372,18 @@ print(response.json())
375
372
376
373
For more information, see [Create client applications to consume webservices](how-to-consume-web-service.md).
377
374
378
-
## <aid="update"></a> Update the web service
375
+
## More inference options
376
+
377
+
### <aid="azuremlcompute"></a> Batch inference
378
+
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.
379
+
380
+
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.
381
+
382
+
### <aid="iotedge"></a> Inference on IoT Edge
383
+
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.
384
+
385
+
386
+
## <aid="update"></a> Update web services
379
387
380
388
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:
381
389
@@ -400,15 +408,11 @@ print(service.state)
400
408
print(service.get_logs())
401
409
```
402
410
403
-
## Clean up
404
-
To delete a deployed web service, use `service.delete()`.
405
-
To delete a registered model, use `model.delete()`.
406
-
407
-
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
415
+
**<aid="customimage"></a> Use a custom base image**
412
416
413
417
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.
414
418
@@ -452,19 +456,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.
459
-
460
-
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.
459
+
## Clean up resources
460
+
To delete a deployed web service, use `service.delete()`.
461
+
To delete a registered model, use `model.delete()`.
461
462
462
-
## <aid="iotedge"></a> Inference on IoT Edge
463
-
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.
463
+
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