Skip to content

Commit 2897d70

Browse files
authored
Merge pull request #111804 from Blackmist/vnet-privateip
refactoring code to make the subnet we are using explicit
2 parents bd0c389 + ef5b788 commit 2897d70

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

articles/machine-learning/how-to-enable-virtual-network.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ms.topic: conceptual
1010
ms.reviewer: larryfr
1111
ms.author: aashishb
1212
author: aashishb
13-
ms.date: 03/13/2020
13+
ms.date: 04/17/2020
1414
---
1515

1616
# Secure Azure ML experimentation and inference jobs within an Azure Virtual Network
@@ -430,14 +430,16 @@ try:
430430
except:
431431
print("Creating new aks cluster")
432432
433+
# Subnet to use for AKS
434+
subnet_name = "default"
433435
# Create AKS configuration
434436
prov_config = AksCompute.provisioning_configuration(location = "eastus2")
435437
# Set info for existing virtual network to create the cluster in
436438
prov_config.vnet_resourcegroup_name = "myvnetresourcegroup"
437439
prov_config.vnet_name = "myvnetname"
438440
prov_config.service_cidr = "10.0.0.0/16"
439441
prov_config.dns_service_ip = "10.0.0.10"
440-
prov_config.subnet_name = "default"
442+
prov_config.subnet_name = subnet_name
441443
prov_config.docker_bridge_cidr = "172.17.0.1/16"
442444
443445
# Create compute target
@@ -446,7 +448,7 @@ except:
446448
aks_target.wait_for_completion(show_output = True)
447449
448450
# Update AKS configuration to use an internal load balancer
449-
update_config = AksUpdateConfiguration(None, "InternalLoadBalancer", "default")
451+
update_config = AksUpdateConfiguration(None, "InternalLoadBalancer", subnet_name)
450452
aks_target.update(update_config)
451453
# Wait for the operation to complete
452454
aks_target.wait_for_completion(show_output = True)

0 commit comments

Comments
 (0)