You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/machine-learning/how-to-enable-virtual-network.md
+90-14Lines changed: 90 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ ms.topic: conceptual
10
10
ms.reviewer: larryfr
11
11
ms.author: aashishb
12
12
author: aashishb
13
-
ms.date: 11/13/2019
13
+
ms.date: 01/03/2020
14
14
---
15
15
16
16
# Secure Azure ML experimentation and inference jobs within an Azure Virtual Network
@@ -40,7 +40,7 @@ This article also provides detailed information about *advanced security setting
40
40
41
41
## Use a storage account for your workspace
42
42
43
-
To use an Azure storage account for the workspace in a virtual network, do the following:
43
+
To use an Azure storage account for the workspace in a virtual network, use the following steps:
44
44
45
45
1. Create a compute resource (for example, a Machine Learning compute instance or cluster) behind a virtual network, or attach a compute resource to the workspace (for example, an HDInsight cluster, virtual machine, or Azure Kubernetes Service cluster). The compute resource can be for experimentation or model deployment.
46
46
@@ -54,7 +54,7 @@ To use an Azure storage account for the workspace in a virtual network, do the f
54
54
55
55

56
56
57
-
1. On the __Firewalls and virtual networks__ page, do the following:
57
+
1. On the __Firewalls and virtual networks__ page, do the following actions:
58
58
- Select __Selected networks__.
59
59
- Under __Virtual networks__, select the __Add existing virtual network__ link. This action adds the virtual network where your compute resides (see step 1).
60
60
@@ -85,7 +85,8 @@ The key vault instance that's associated with the workspace is used by Azure Mac
85
85
* Passwords to Azure Container Repository instances
86
86
* Connection strings to data stores
87
87
88
-
To use Azure Machine Learning experimentation capabilities with Azure Key Vault behind a virtual network, do the following:
88
+
To use Azure Machine Learning experimentation capabilities with Azure Key Vault behind a virtual network, use the following steps:
89
+
89
90
1. Go to the key vault that's associated with the workspace.
90
91
91
92
[](./media/how-to-enable-virtual-network/workspace-key-vault.png#lightbox)
@@ -94,7 +95,7 @@ To use Azure Machine Learning experimentation capabilities with Azure Key Vault
94
95
95
96

96
97
97
-
1. On the __Firewalls and virtual networks__ page, do the following:
98
+
1. On the __Firewalls and virtual networks__ page, do the following actions:
98
99
- Under __Allow access from__, select __Selected networks__.
99
100
- Under __Virtual networks__, select __Add existing virtual networks__ to add the virtual network where your experimentation compute resides.
100
101
- Under __Allow trusted Microsoft services to bypass this firewall__, select __Yes__.
@@ -155,11 +156,11 @@ The NSG rule configuration in the Azure portal is shown in the following images:
155
156
156
157
### <aid="limiting-outbound-from-vnet"></a> Limit outbound connectivity from the virtual network
157
158
158
-
If you don't want to use the default outbound rules and you do want to limit the outbound access of your virtual network, do the following:
159
+
If you don't want to use the default outbound rules and you do want to limit the outbound access of your virtual network, use the following steps:
159
160
160
161
- Deny outbound internet connection by using the NSG rules.
161
162
162
-
- Limit outbound traffic to the following:
163
+
- Limit outbound traffic to the following items:
163
164
- Azure Storage, by using __Service Tag__ of __Storage.Region_Name__ (for example, Storage.EastUS)
164
165
- Azure Container Registry, by using __Service Tag__ of __AzureContainerRegistry.Region_Name__ (for example, AzureContainerRegistry.EastUS)
165
166
- Azure Machine Learning, by using __Service Tag__ of __AzureMachineLearning__
@@ -220,13 +221,13 @@ For more information, see [Create an Azure Batch pool in a virtual network](../b
220
221
221
222
### Create a compute cluster in a virtual network
222
223
223
-
To create a Machine Learning Compute cluster, do the following:
224
+
To create a Machine Learning Compute cluster, use the following steps:
224
225
225
226
1. In the [Azure portal](https://portal.azure.com), select your Azure Machine Learning workspace.
226
227
227
228
1. In the __Application__ section, select __Compute__, and then select __Add compute__.
228
229
229
-
1. To configure this compute resource to use a virtual network, do the following:
230
+
1. To configure this compute resource to use a virtual network, do the following actions:
230
231
231
232
a. For __Network configuration__, select __Advanced__.
232
233
@@ -294,14 +295,14 @@ For specific information on using Azure Databricks with a virtual network, see [
294
295
> [!IMPORTANT]
295
296
> Azure Machine Learning supports only virtual machines that are running Ubuntu.
296
297
297
-
To use a virtual machine or Azure HDInsight cluster in a virtual network with your workspace, do the following:
298
+
To use a virtual machine or Azure HDInsight cluster in a virtual network with your workspace, use the following steps:
298
299
299
300
1. Create a VMor HDInsight cluster by using the Azure portal or the Azure CLI, and put the cluster in an Azure virtual network. For more information, see the following articles:
300
301
* [Create and manage Azure virtual networks for Linux VMs](https://docs.microsoft.com/azure/virtual-machines/linux/tutorial-virtual-network)
301
302
302
303
* [Extend HDInsight using an Azure virtual network](https://docs.microsoft.com/azure/hdinsight/hdinsight-extend-hadoop-virtual-network)
303
304
304
-
1. To allow Azure Machine Learning to communicate with the SSH port on the VMor cluster, configure a source entry for the network security group. The SSH port is usually port 22. To allow traffic from this source, do the following:
305
+
1. To allow Azure Machine Learning to communicate with the SSH port on the VMor cluster, configure a source entry for the network security group. The SSH port is usually port 22. To allow traffic from this source, do the following actions:
305
306
306
307
* In the __Source__ drop-down list, select __Service Tag__.
307
308
@@ -329,7 +330,7 @@ To use a virtual machine or Azure HDInsight cluster in a virtual network with yo
329
330
330
331
## Use Azure Kubernetes Service (AKS)
331
332
332
-
To add AKSin a virtual network to your workspace, do the following:
333
+
To add AKSin a virtual network to your workspace, use the following steps:
333
334
334
335
> [!IMPORTANT]
335
336
> Before you begin the following procedure, follow the prerequisites in the [Configure advanced networking in Azure Kubernetes Service (AKS)](https://docs.microsoft.com/azure/aks/configure-advanced-networking#prerequisites) how-to and plan the IP addressing for your cluster.
@@ -344,7 +345,7 @@ To add AKS in a virtual network to your workspace, do the following:
344
345
345
346
1. In the __Application__ section, select __Compute__, and then select __Add compute__.
346
347
347
-
1. To configure this compute resource to use a virtual network, do the following:
348
+
1. To configure this compute resource to use a virtual network, do the following actions:
348
349
349
350
- For __Network configuration__, select __Advanced__.
When the creation process is completed, you can run inference, or model scoring, on an AKS cluster behind a virtual network. For more information, see [How to deploy to AKS](how-to-deploy-and-where.md).
392
393
394
+
### Use private IPs with Azure Kubernetes Service
395
+
396
+
By default, a public IP address is assigned to AKS deployments. When using AKS inside a virtual network, you can use a private IP address instead. Private IP addresses are only accessible from inside the virtual network or joined networks.
397
+
398
+
A private IP address is enabled by configuring AKS to use an _internal load balancer_.
399
+
400
+
> [!IMPORTANT]
401
+
> You cannot enable private IP when creating the Azure Kubernetes Service cluster. It must be enabled as an update to an existing cluster.
402
+
403
+
The following code snippet demonstrates how to **create a new AKS cluster**, and then update it to use a private IP/internal load balancer:
404
+
405
+
```python
406
+
import azureml.core
407
+
from azureml.core.compute.aks import AksUpdateConfiguration
408
+
from azureml.core.compute import AksCompute, ComputeTarget
az rest --method put --uri https://management.azure.com"/subscriptions/<subscription-id>/resourcegroups/<resource-group>/providers/Microsoft.ContainerService/managedClusters/<aks-resource-id>?api-version=2018-11-19 --body @body.json
444
+
```
445
+
446
+
The contents of the `body.json`file referenced by the command are similar to the following JSON document:
> Currently, you cannot configure the load balancer when performing an __attach__ operation on an existing cluster. You must first attach the cluster, and then perform an update operation to change the load balancer.
467
+
468
+
For more information on using the internal load balancer withAKS, see [Use internal load balancer with Azure Kubernetes Service](/azure/aks/internal-lb).
469
+
393
470
## Use Azure Firewall
394
471
395
472
When using Azure Firewall, you must configure a network rule to allow traffic to andfrom the following addresses:
@@ -411,4 +488,3 @@ For more information on configuring a network rule, see [Deploy and configure Az
411
488
* [Set up training environments](how-to-set-up-training-targets.md)
412
489
* [Where to deploy models](how-to-deploy-and-where.md)
0 commit comments