Skip to content

Commit 67f40c0

Browse files
Merge pull request #110817 from Blackmist/toc-draft
revising
2 parents 3c28510 + 7bc3ab9 commit 67f40c0

File tree

2 files changed

+266
-255
lines changed

2 files changed

+266
-255
lines changed

articles/machine-learning/how-to-consume-web-service.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
---
22
title: Create client for model deployed as web service
33
titleSuffix: Azure Machine Learning
4-
description: Learn how to consume a web service that was generated when a model was deployed with Azure Machine Learning model. The web service exposes a REST API. Create clients for this API by using the programming language of your choice.
4+
description: Learn how to call a web service endpoint that was generated when a model was deployed from Azure Machine Learning. The endpoint exposes a REST API, which you can call to perform inference with the model. Create clients for this API by using the programming language of your choice.
55
services: machine-learning
66
ms.service: machine-learning
77
ms.subservice: core
88
ms.topic: conceptual
99
ms.author: aashishb
1010
author: aashishb
1111
ms.reviewer: larryfr
12-
ms.date: 01/07/2020
12+
ms.date: 04/14/2020
1313
ms.custom: seodec18
1414

1515

@@ -19,9 +19,9 @@ ms.custom: seodec18
1919
# Consume an Azure Machine Learning model deployed as a web service
2020
[!INCLUDE [applies-to-skus](../../includes/aml-applies-to-basic-enterprise-sku.md)]
2121

22-
Deploying an Azure Machine Learning model as a web service creates a REST API. You can send data to this API and receive the prediction returned by the model. In this document, learn how to create clients for the web service by using C#, Go, Java, and Python.
22+
Deploying an Azure Machine Learning model as a web service creates a REST API endpoint. You can send data to this endpoint and receive the prediction returned by the model. In this document, learn how to create clients for the web service by using C#, Go, Java, and Python.
2323

24-
You create a web service when you deploy an image to Azure Container Instances, Azure Kubernetes Service, or field-programmable gate arrays (FPGA). You create images from registered models and scoring files. You retrieve the URI used to access a web service by using the [Azure Machine Learning SDK](https://docs.microsoft.com/python/api/overview/azure/ml/intro?view=azure-ml-py). If authentication is enabled, you can also use the SDK to get the authentication keys or tokens.
24+
You create a web service when you deploy a model to your local environment, Azure Container Instances, Azure Kubernetes Service, or field-programmable gate arrays (FPGA). You retrieve the URI used to access the web service by using the [Azure Machine Learning SDK](https://docs.microsoft.com/python/api/overview/azure/ml/intro?view=azure-ml-py). If authentication is enabled, you can also use the SDK to get the authentication keys or tokens.
2525

2626
The general workflow for creating a client that uses a machine learning web service is:
2727

@@ -173,6 +173,17 @@ The web service can accept multiple sets of data in one request. It returns a JS
173173

174174
For information on how to enable support for binary data in your service, see [Binary data](how-to-deploy-and-where.md#binary).
175175

176+
> [!TIP]
177+
> Enabling support for binary data happens in the score.py file used by the deployed model. From the client, use the HTTP functionality of your programming language. For example, the following snippet sends the contents of a JPG file to a web service:
178+
>
179+
> ```python
180+
> import requests
181+
> # Load image data
182+
> data = open('example.jpg', 'rb').read()
183+
> # Post raw data to scoring URI
184+
> res = request.post(url='<scoring-uri>', data=data, headers={'Content-Type': 'application/> octet-stream'})
185+
> ```
186+
176187
### Cross-origin resource sharing (CORS)
177188

178189
For information on enabling CORS support in your service, see [Cross-origin resource sharing](how-to-deploy-and-where.md#cors).

0 commit comments

Comments
 (0)