Skip to content

Commit 1026fbf

Browse files
authored
Update how-to-deploy-and-where.md
1 parent d75ad23 commit 1026fbf

File tree

1 file changed

+35
-34
lines changed

1 file changed

+35
-34
lines changed

articles/machine-learning/service/how-to-deploy-and-where.md

Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ The following table provides an example of creating a deployment configuration f
215215

216216
The following sections demonstrate how to create the deployment configuration, and then use it to deploy the web service.
217217

218-
## Where to deploy
218+
## Deploy to target
219219

220220
### <a id="local"></a> Deploy locally
221221

@@ -267,19 +267,13 @@ For more information, see the reference documentation for the [AciWebservice](ht
267267

268268
You can use an existing AKS cluster or create a new one using the Azure Machine Learning SDK, CLI, or the Azure portal.
269269

270+
<a id="deploy-aks"></a>
270271

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 <a href="#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 <a href="#create-attach-aks">here</a>.
274273

275-
#### Deploy to AKS <a id="deploy-aks"></a>
276274

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
280-
```
275+
**Using the SDK**
281276

282-
You can also use the Python SDK:
283277
```python
284278
aks_target = AksCompute(ws,"myaks")
285279
deployment_config = AksWebservice.deploy_configuration(cpu_cores = 1, memory_gb = 1)
@@ -289,17 +283,20 @@ print(service.state)
289283
print(service.get_logs())
290284
```
291285

292-
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.
293287

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+
```
295293

296-
#### Create or attach an AKS cluster <a id="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<a id="create-attach-aks"></a>
295+
**Time estimate:** Approximately 5 minutes.
299296

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.
301299
302-
##### Create a new AKS cluster
303300
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.
304301
The following example demonstrates how to create a new Azure Kubernetes Service cluster:
305302

@@ -329,7 +326,7 @@ For more information on creating an AKS cluster outside of the Azure Machine Lea
329326
330327
**Time estimate**: Approximately 20 minutes.
331328

332-
##### Attach an existing AKS cluster
329+
#### Attach an existing AKS cluster
333330

334331
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:
335332

@@ -374,7 +371,18 @@ print(response.json())
374371

375372
For more information, see [Create client applications to consume webservices](how-to-consume-web-service.md).
376373

377-
## <a id="update"></a> Update the web service
374+
## More inference options
375+
376+
### <a id="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+
### <a id="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+
## <a id="update"></a> Update web services
378386

379387
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:
380388

@@ -399,15 +407,11 @@ print(service.state)
399407
print(service.get_logs())
400408
```
401409

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--).
410+
<a id="advanced-config"></a>
407411

408-
## Advanced configuration settings <a id="advanced-config"></a>
412+
## Advanced settings
409413

410-
### <a id="customimage"></a> Use a custom base image
414+
**<a id="customimage"></a> Use a custom base image**
411415

412416
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.
413417

@@ -451,19 +455,16 @@ If your model is trained on Azure Machine Learning Compute, using __version 1.0.
451455
image_config.base_image = run.properties["AzureML.DerivedImageName"]
452456
```
453457

454-
## Other inference options
455-
456-
### <a id="azuremlcompute"></a> Batch inference
457-
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()`.
460461

461-
## <a id="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--).
463463

464464
## Next steps
465465
* [Deployment troubleshooting](how-to-troubleshoot-deployment.md)
466466
* [Secure Azure Machine Learning web services with SSL](how-to-secure-web-service.md)
467467
* [Consume a ML Model deployed as a web service](how-to-consume-web-service.md)
468468
* [Monitor your Azure Machine Learning models with Application Insights](how-to-enable-app-insights.md)
469469
* [Collect data for models in production](how-to-enable-data-collection.md)
470+

0 commit comments

Comments
 (0)