Skip to content

Commit ffe20b9

Browse files
author
Larry Franks
committed
updates per code checkin
1 parent a5ce2b4 commit ffe20b9

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

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

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ 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

@@ -86,19 +86,21 @@ az ml online-endpoint create -f endpoint.yml --set public_network_access=disable
8686
# [Python SDK](#tab/python)
8787

8888
```python
89-
endpoint = ManagedOnlineEndpoint(name='my-online-endpoint',
89+
from azure.ai.ml.entities._common import PublicNetworkAccess
90+
91+
endpoint = ManagedOnlineEndpoint(name='my-online-endpoint',
9092
description='this is a sample online endpoint',
9193
tags={'foo': 'bar'},
92-
auth_mode=AuthMode.Key,
93-
public_network_access=ManagedEndpointAccess.Disabled
94-
# public_network_access=ManagedEndpointAccess.Enabled
94+
auth_mode="key",
95+
public_network_access=PublicNetworkAccess.Disabled
96+
# public_network_access=PublicNetworkAccess.Enabled
9597
)
9698

97-
mlclient.online_endpoints.create_or_update(endpoint)
99+
ml_client.begin_create_or_update(endpoint)
98100
```
99101

100102
---
101-
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.
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.
102104

103105
## Outbound (resource access)
104106

@@ -124,17 +126,16 @@ az ml online-deployment create -f deployment.yml --set egress_public_network_acc
124126
blue_deployment = ManagedOnlineDeployment(name='blue',
125127
endpoint_name='my-online-endpoint',
126128
model=model,
127-
#code_configuration=CodeConfiguration(code_local_path='./model-1/onlinescoring/', scoring_script='score.py'),
128-
code_local_path='./model-1/onlinescoring/',
129-
scoring_script='score.py',
129+
code_configuration=CodeConfiguration(code_local_path='./model-1/onlinescoring/',
130+
scoring_script='score.py'),
130131
environment=env,
131132
instance_type='Standard_F2s_v2',
132133
instance_count=1,
133-
egress_public_network_access=MangedDeploymentAccess.Disabled
134-
# egress_public_network_access=MangedDeploymentAccess.Enabled
134+
egress_public_network_access=PublicNetworkAccess.Disabled
135+
# egress_public_network_access=PublicNetworkAccess.Enabled
135136
)
136137

137-
mlclient.online_deployments.create_or_update(blue_deployment, all_traffic=True) # set all traffic to this deployment
138+
ml_client.begin_create_or_update(blue_deployment)
138139
```
139140

140141
---

0 commit comments

Comments
 (0)