Skip to content

Commit 8061a68

Browse files
Merge pull request #281550 from mbender-ms/lb-freshness-aug-01
lb - freshness - July 2024
2 parents 3928641 + fb3695b commit 8061a68

5 files changed

+91
-86
lines changed

articles/load-balancer/quickstart-load-balancer-standard-internal-cli.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Create a resource group with [az group create](/cli/azure/group#az-group-create)
3232
```azurecli-interactive
3333
az group create \
3434
--name CreateIntLBQS-rg \
35-
--location westus3
35+
--location westus2
3636
```
3737

3838
When you create an internal load balancer, a virtual network is configured as the network for the load balancer.
@@ -46,7 +46,7 @@ Create a virtual network by using [az network vnet create](/cli/azure/network/vn
4646
```azurecli-interactive
4747
az network vnet create \
4848
--resource-group CreateIntLBQS-rg \
49-
--location westus3 \
49+
--location westus2 \
5050
--name myVNet \
5151
--address-prefixes 10.1.0.0/16 \
5252
--subnet-name myBackendSubnet \
@@ -88,12 +88,14 @@ az network vnet subnet create \
8888
Use [az network bastion create](/cli/azure/network/bastion#az-network-bastion-create) to create a host.
8989

9090
```azurecli-interactive
91+
az config set extension.use_dynamic_install=yes_without_prompt
92+
9193
az network bastion create \
9294
--resource-group CreateIntLBQS-rg \
9395
--name myBastionHost \
9496
--public-ip-address myBastionIP \
9597
--vnet-name myVNet \
96-
--location westus3
98+
--location westus2
9799
```
98100

99101
It can take a few minutes for the Azure Bastion host to deploy.
@@ -237,7 +239,7 @@ Create the virtual machines with [az vm create](/cli/azure/vm#az-vm-create).
237239
--resource-group CreateIntLBQS-rg \
238240
--name myVM$n \
239241
--nics myNicVM$n \
240-
--image win2019datacenter \
242+
--image win2022datacenter \
241243
--admin-username azureuser \
242244
--zone $n \
243245
--no-wait

articles/load-balancer/quickstart-load-balancer-standard-internal-powershell.md

Lines changed: 44 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ description: This quickstart shows how to create an internal load balancer using
55
author: mbender-ms
66
ms.service: load-balancer
77
ms.topic: quickstart
8-
ms.date: 05/31/2023
8+
ms.date: 07/23/2024
99
ms.author: mbender
1010
ms.custom: devx-track-azurepowershell, mode-api, template-quickstart
1111
#Customer intent: I want to create a load balancer so that I can load balance internal traffic to VMs.
1212
---
1313

14-
# Quickstart: Create an internal load balancer to load balance VMs using Azure PowerShell
14+
# Quickstart: Create an internal load balancer to load balance virtual machines using Azure PowerShell
1515

16-
Get started with Azure Load Balancer by using Azure PowerShell to create an internal load balancer and two virtual machines.Additional resources include Azure Bastion, NAT Gateway, a virtual network, and the required subnets.
16+
Get started with Azure Load Balancer creating an internal load balancer and two virtual machines with Azure PowerShell. Also, you deploy other resources including Azure Bastion, NAT Gateway, a virtual network, and the required subnets.
1717

1818
:::image type="content" source="media/quickstart-load-balancer-standard-internal-portal/internal-load-balancer-resources.png" alt-text="Diagram of resources deployed for internal load balancer." lightbox="media/quickstart-load-balancer-standard-internal-portal/internal-load-balancer-resources.png":::
1919

@@ -32,7 +32,11 @@ An Azure resource group is a logical container into which Azure resources are de
3232
Create a resource group with [New-AzResourceGroup](/powershell/module/az.resources/new-azresourcegroup).
3333

3434
```azurepowershell-interactive
35-
New-AzResourceGroup -Name 'CreateIntLBQS-rg' -Location 'eastus'
35+
$rg = @{
36+
Name = 'CreateINTLBQS-rg'
37+
Location = 'westus2'
38+
}
39+
New-AzResourceGroup @rg
3640
```
3741

3842
## Configure virtual network
@@ -55,8 +59,8 @@ Use [New-AzPublicIpAddress](/powershell/module/az.network/new-azpublicipaddress)
5559
## Create public IP address for NAT gateway and place IP in variable ##
5660
$gwpublicip = @{
5761
Name = 'myNATgatewayIP'
58-
ResourceGroupName = 'CreateIntLBQS-rg'
59-
Location = 'eastus'
62+
ResourceGroupName = $rg.name
63+
Location = 'westus2'
6064
Sku = 'Standard'
6165
AllocationMethod = 'static'
6266
Zone = 1,2,3
@@ -70,8 +74,8 @@ To create a zonal public IP address in zone 1, use the following command:
7074
## Create a zonal public IP address for NAT gateway and place IP in variable ##
7175
$gwpublicip = @{
7276
Name = 'myNATgatewayIP'
73-
ResourceGroupName = 'CreateIntLBQS-rg'
74-
Location = 'eastus'
77+
ResourceGroupName = $rg.name
78+
Location = 'westus2'
7579
Sku = 'Standard'
7680
AllocationMethod = 'static'
7781
Zone = 1
@@ -101,11 +105,11 @@ $gwpublicip = New-AzPublicIpAddress @gwpublicip
101105
102106
## Create NAT gateway resource ##
103107
$nat = @{
104-
ResourceGroupName = 'CreateIntLBQS-rg'
108+
ResourceGroupName = $rg.name
105109
Name = 'myNATgateway'
106110
IdleTimeoutInMinutes = '10'
107111
Sku = 'Standard'
108-
Location = 'eastus'
112+
Location = 'westus2'
109113
PublicIpAddress = $gwpublicip
110114
}
111115
$natGateway = New-AzNatGateway @nat
@@ -128,8 +132,8 @@ $bastsubnetConfig = New-AzVirtualNetworkSubnetConfig @bastsubnet
128132
## Create the virtual network ##
129133
$net = @{
130134
Name = 'myVNet'
131-
ResourceGroupName = 'CreateIntLBQS-rg'
132-
Location = 'eastus'
135+
ResourceGroupName = $rg.name
136+
Location = 'westus2'
133137
AddressPrefix = '10.1.0.0/16'
134138
Subnet = $subnetConfig,$bastsubnetConfig
135139
}
@@ -138,16 +142,16 @@ $vnet = New-AzVirtualNetwork @net
138142
## Create public IP address for bastion host. ##
139143
$bastionip = @{
140144
Name = 'myBastionIP'
141-
ResourceGroupName = 'CreateIntLBQS-rg'
142-
Location = 'eastus'
145+
ResourceGroupName = $rg.name
146+
Location = 'westus2'
143147
Sku = 'Standard'
144148
AllocationMethod = 'Static'
145149
}
146150
$bastionip = New-AzPublicIpAddress @bastionip
147151
148152
## Create bastion host ##
149153
$bastion = @{
150-
ResourceGroupName = 'CreateIntLBQS-rg'
154+
ResourceGroupName = $rg.name
151155
Name = 'myBastion'
152156
PublicIpAddress = $bastionip
153157
VirtualNetwork = $vnet
@@ -172,8 +176,8 @@ $rule1 = New-AzNetworkSecurityRuleConfig @nsgrule
172176
## Create network security group ##
173177
$nsg = @{
174178
Name = 'myNSG'
175-
ResourceGroupName = 'CreateIntLBQS-rg'
176-
Location = 'eastus'
179+
ResourceGroupName = $rg.name
180+
Location = 'westus2'
177181
SecurityRules = $rule1
178182
}
179183
New-AzNetworkSecurityGroup @nsg
@@ -197,7 +201,7 @@ This section details how you can create and configure the following components o
197201
## Place virtual network created in previous step into a variable. ##
198202
$net = @{
199203
Name = 'myVNet'
200-
ResourceGroupName = 'CreateIntLBQS-rg'
204+
ResourceGroupName = $rg.name
201205
}
202206
$vnet = Get-AzVirtualNetwork @net
203207
@@ -236,9 +240,9 @@ $rule = New-AzLoadBalancerRuleConfig @lbrule -EnableTcpReset
236240
237241
## Create the load balancer resource. ##
238242
$loadbalancer = @{
239-
ResourceGroupName = 'CreateIntLBQS-rg'
243+
ResourceGroupName = $rg.name
240244
Name = 'myLoadBalancer'
241-
Location = 'eastus'
245+
Location = 'westus2'
242246
Sku = 'Standard'
243247
FrontendIpConfiguration = $feip
244248
BackendAddressPool = $bePool
@@ -276,32 +280,32 @@ $cred = Get-Credential
276280
## Place virtual network created in previous step into a variable. ##
277281
$net = @{
278282
Name = 'myVNet'
279-
ResourceGroupName = 'CreateIntLBQS-rg'
283+
ResourceGroupName = $rg.name
280284
}
281285
$vnet = Get-AzVirtualNetwork @net
282286
283287
## Place the load balancer into a variable. ##
284288
$lb = @{
285289
Name = 'myLoadBalancer'
286-
ResourceGroupName = 'CreateIntLBQS-rg'
290+
ResourceGroupName = $rg.name
287291
}
288292
$bepool = Get-AzLoadBalancer @lb | Get-AzLoadBalancerBackendAddressPoolConfig
289293
290294
## Place the network security group into a variable. ##
291-
$sg = {
295+
$sg = @{
292296
Name = 'myNSG'
293-
ResourceGroupName = 'CreateIntLBQS-rg' @sg
297+
ResourceGroupName = $rg.name
294298
}
295-
$nsg = Get-AzNetworkSecurityGroup
299+
$nsg = Get-AzNetworkSecurityGroup @sg
296300
297301
## For loop with variable to create virtual machines for load balancer backend pool. ##
298302
for ($i=1; $i -le 2; $i++)
299303
{
300304
## Command to create network interface for VMs ##
301305
$nic = @{
302306
Name = "myNicVM$i"
303-
ResourceGroupName = 'CreateIntLBQS-rg'
304-
Location = 'eastus'
307+
ResourceGroupName = $rg.name
308+
Location = 'westus2'
305309
Subnet = $vnet.Subnets[0]
306310
NetworkSecurityGroup = $nsg
307311
LoadBalancerBackendAddressPool = $bepool
@@ -330,8 +334,8 @@ for ($i=1; $i -le 2; $i++)
330334
331335
## Create the virtual machine for VMs ##
332336
$vm = @{
333-
ResourceGroupName = 'CreateIntLBQS-rg'
334-
Location = 'eastus'
337+
ResourceGroupName = $rg.name
338+
Location = 'westus2'
335339
VM = $vmConfig
336340
Zone = "$i"
337341
}
@@ -370,9 +374,9 @@ for ($i=1; $i -le 2; $i++)
370374
Publisher = 'Microsoft.Compute'
371375
ExtensionType = 'CustomScriptExtension'
372376
ExtensionName = 'IIS'
373-
ResourceGroupName = 'CreateIntLBQS-rg'
377+
ResourceGroupName = $rg.name
374378
VMName = "myVM$i"
375-
Location = 'eastus'
379+
Location = 'westus2'
376380
TypeHandlerVersion = '1.8'
377381
SettingString = '{"commandToExecute":"powershell Add-WindowsFeature Web-Server; powershell Add-Content -Path \"C:\\inetpub\\wwwroot\\Default.htm\" -Value $($env:computername)"}'
378382
}
@@ -414,22 +418,22 @@ $cred = Get-Credential
414418
## Place the virtual network into a variable. ##
415419
$net = @{
416420
Name = 'myVNet'
417-
ResourceGroupName = 'CreateIntLBQS-rg'
421+
ResourceGroupName = $rg.name
418422
}
419423
$vnet = Get-AzVirtualNetwork @net
420424
421425
## Place the network security group into a variable. ##
422-
$sg = {
426+
$sg = @{
423427
Name = 'myNSG'
424-
ResourceGroupName = 'CreateIntLBQS-rg' @sg
428+
ResourceGroupName = $rg.name
425429
}
426-
$nsg = Get-AzNetworkSecurityGroup
430+
$nsg = Get-AzNetworkSecurityGroup @sg
427431
428432
## Command to create network interface for VM ##
429433
$nic = @{
430434
Name = "myNicTestVM"
431-
ResourceGroupName = 'CreateIntLBQS-rg'
432-
Location = 'eastus'
435+
ResourceGroupName = $rg.name
436+
Location = 'westus2'
433437
Subnet = $vnet.Subnets[0]
434438
NetworkSecurityGroup = $nsg
435439
}
@@ -457,8 +461,8 @@ $vmConfig = New-AzVMConfig @vmsz `
457461
458462
## Create the virtual machine for VMs ##
459463
$vm = @{
460-
ResourceGroupName = 'CreateIntLBQS-rg'
461-
Location = 'eastus'
464+
ResourceGroupName = $rg.name
465+
Location = 'westus2'
462466
VM = $vmConfig
463467
}
464468
New-AzVM @vm
@@ -491,7 +495,7 @@ To see the load balancer distribute traffic across all three VMs, you can force-
491495
When no longer needed, you can use the [Remove-AzResourceGroup](/powershell/module/az.resources/remove-azresourcegroup) command to remove the resource group, load balancer, and the remaining resources.
492496

493497
```azurepowershell-interactive
494-
Remove-AzResourceGroup -Name 'CreateIntLBQS-rg'
498+
Remove-AzResourceGroup -Name $rg.name
495499
```
496500

497501
## Next steps

0 commit comments

Comments
 (0)