Skip to content

Commit 489bfcc

Browse files
authored
Merge pull request #77491 from j-martens/patch-478
Update how-to-deploy-and-where.md
2 parents de0a4c9 + 1026fbf commit 489bfcc

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
@@ -216,7 +216,7 @@ The following table provides an example of creating a deployment configuration f
216216

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

219-
## Where to deploy
219+
## Deploy to target
220220

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

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

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

271+
<a id="deploy-aks"></a>
271272

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

276-
#### Deploy to AKS <a id="deploy-aks"></a>
277275

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
281-
```
276+
**Using the SDK**
282277

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

293-
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.
294288

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

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

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

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

333-
##### Attach an existing AKS cluster
330+
#### Attach an existing AKS cluster
334331

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

@@ -375,7 +372,18 @@ print(response.json())
375372

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

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

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

@@ -400,15 +408,11 @@ print(service.state)
400408
print(service.get_logs())
401409
```
402410

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

409-
## Advanced configuration settings <a id="advanced-config"></a>
413+
## Advanced settings
410414

411-
### <a id="customimage"></a> Use a custom base image
415+
**<a id="customimage"></a> Use a custom base image**
412416

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

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

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

462-
## <a id="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--).
464464

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

0 commit comments

Comments
 (0)