Skip to content

Commit a26a50f

Browse files
Merge pull request #212165 from Blackmist/v2-inference
adding sdk v2 info
2 parents 5eb55d9 + 9e94a24 commit a26a50f

File tree

1 file changed

+49
-3
lines changed

1 file changed

+49
-3
lines changed

articles/machine-learning/how-to-secure-online-endpoint.md

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ ms.topic: how-to
99
ms.reviewer: larryfr
1010
author: dem108
1111
ms.author: sehan
12-
ms.date: 06/06/2022
12+
ms.date: 10/04/2022
1313
ms.custom: event-tier1-build-2022
1414
---
1515

1616
# Use network isolation with managed online endpoints (preview)
1717

18+
[!INCLUDE [SDK/CLI v2](../../includes/machine-learning-dev-v2.md)]
19+
1820
When deploying a machine learning model to a managed online endpoint, you can secure communication with the online endpoint by using [private endpoints](../private-link/private-endpoint-overview.md). Using a private endpoint with online endpoints is currently a preview feature.
1921

2022
[!INCLUDE [preview disclaimer](../../includes/machine-learning-preview-generic-disclaimer.md)]
@@ -29,7 +31,10 @@ The following diagram shows how communications flow through private endpoints to
2931

3032
* To use Azure machine learning, you must have an Azure subscription. If you don't have an Azure subscription, create a free account before you begin. Try the [free or paid version of Azure Machine Learning](https://azure.microsoft.com/free/) today.
3133

32-
* You must install and configure the Azure CLI and ML extension. For more information, see [Install, set up, and use the CLI (v2)](how-to-configure-cli.md).
34+
* You must install and configure the Azure CLI and ML extension or the AzureML Python SDK v2. For more information, see the following articles:
35+
36+
* [Install, set up, and use the CLI (v2)](how-to-configure-cli.md).
37+
* [Install the Python SDK v2](https://aka.ms/sdk-v2-install).
3338

3439
* You must have an Azure Resource Group, in which you (or the service principal you use) need to have `Contributor` access. You'll have such a resource group if you configured your ML extension per the above article.
3540

@@ -72,11 +77,30 @@ The following diagram shows how communications flow through private endpoints to
7277
7378
To secure scoring requests to the online endpoint to your virtual network, set the `public_network_access` flag for the endpoint to `disabled`:
7479
80+
# [Azure CLI](#tab/cli)
81+
7582
```azurecli
7683
az ml online-endpoint create -f endpoint.yml --set public_network_access=disabled
7784
```
7885
79-
When `public_network_access` is `disabled`, inbound scoring requests are received using the [private endpoint of the Azure Machine Learning workspace](./how-to-configure-private-link.md) and the endpoint can't be reached from public networks.
86+
# [Python SDK](#tab/python)
87+
88+
```python
89+
from azure.ai.ml.entities._common import PublicNetworkAccess
90+
91+
endpoint = ManagedOnlineEndpoint(name='my-online-endpoint',
92+
description='this is a sample online endpoint',
93+
tags={'foo': 'bar'},
94+
auth_mode="key",
95+
public_network_access=PublicNetworkAccess.Disabled
96+
# public_network_access=PublicNetworkAccess.Enabled
97+
)
98+
99+
ml_client.begin_create_or_update(endpoint)
100+
```
101+
102+
---
103+
When `public_network_access` is `Disabled`, inbound scoring requests are received using the [private endpoint of the Azure Machine Learning workspace](./how-to-configure-private-link.md) and the endpoint can't be reached from public networks.
80104

81105
## Outbound (resource access)
82106

@@ -90,10 +114,32 @@ The following are the resources that the deployment communicates with over the p
90114

91115
When you configure the `egress_public_network_access` to `disabled`, a new private endpoint is created per deployment, per service. For example, if you set the flag to `disabled` for three deployments to an online endpoint, nine private endpoints are created. Each deployment would have three private endpoints that are used to communicate with the workspace, blob, and container registry.
92116

117+
# [Azure CLI](#tab/cli)
118+
93119
```azurecli
94120
az ml online-deployment create -f deployment.yml --set egress_public_network_access=disabled
95121
```
96122

123+
# [Python SDK](#tab/python)
124+
125+
```python
126+
blue_deployment = ManagedOnlineDeployment(name='blue',
127+
endpoint_name='my-online-endpoint',
128+
model=model,
129+
code_configuration=CodeConfiguration(code_local_path='./model-1/onlinescoring/',
130+
scoring_script='score.py'),
131+
environment=env,
132+
instance_type='Standard_DS2_v2',
133+
instance_count=1,
134+
egress_public_network_access=PublicNetworkAccess.Disabled
135+
# egress_public_network_access=PublicNetworkAccess.Enabled
136+
)
137+
138+
ml_client.begin_create_or_update(blue_deployment)
139+
```
140+
141+
---
142+
97143
## Scenarios
98144

99145
The following table lists the supported configurations when configuring inbound and outbound communications for an online endpoint:

0 commit comments

Comments
 (0)