Skip to content

Commit ea2b035

Browse files
author
Michael Bender
committed
Freshness updates
1 parent 6606e7f commit ea2b035

File tree

1 file changed

+31
-31
lines changed

1 file changed

+31
-31
lines changed

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

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ titleSuffix: Azure Load Balancer
44
description: This quickstart shows how to create a load balancer using Azure PowerShell.
55
author: mbender-ms
66
ms.author: mbender
7-
ms.date: 05/01/2023
7+
ms.date: 07/23/2024
88
ms.topic: quickstart
99
ms.service: load-balancer
1010
ms.custom: devx-track-azurepowershell, mode-api, template-quickstart, engagement-fy23
@@ -33,7 +33,7 @@ Create a resource group with [New-AzResourceGroup](/powershell/module/az.resourc
3333
```azurepowershell-interactive
3434
$rg = @{
3535
Name = 'CreatePubLBQS-rg'
36-
Location = 'eastus'
36+
Location = 'westus2'
3737
}
3838
New-AzResourceGroup @rg
3939
```
@@ -45,8 +45,8 @@ Use [New-AzPublicIpAddress](/powershell/module/az.network/new-azpublicipaddress)
4545
```azurepowershell-interactive
4646
$publicip = @{
4747
Name = 'myPublicIP'
48-
ResourceGroupName = 'CreatePubLBQS-rg'
49-
Location = 'eastus'
48+
ResourceGroupName = $rg.name
49+
Location = 'westus2'
5050
Sku = 'Standard'
5151
AllocationMethod = 'static'
5252
Zone = 1,2,3
@@ -59,8 +59,8 @@ To create a zonal public IP address in zone 1, use the following command:
5959
```azurepowershell-interactive
6060
$publicip = @{
6161
Name = 'myPublicIP'
62-
ResourceGroupName = 'CreatePubLBQS-rg'
63-
Location = 'eastus'
62+
ResourceGroupName = $rg.name
63+
Location = 'westus2'
6464
Sku = 'Standard'
6565
AllocationMethod = 'static'
6666
Zone = 1
@@ -86,7 +86,7 @@ This section details how you can create and configure the following components o
8686
## Place public IP created in previous steps into variable. ##
8787
$pip = @{
8888
Name = 'myPublicIP'
89-
ResourceGroupName = 'CreatePubLBQS-rg'
89+
ResourceGroupName = $rg.name
9090
}
9191
$publicIp = Get-AzPublicIpAddress @pip
9292
@@ -124,9 +124,9 @@ $rule = New-AzLoadBalancerRuleConfig @lbrule -EnableTcpReset -DisableOutboundSNA
124124
125125
## Create the load balancer resource. ##
126126
$loadbalancer = @{
127-
ResourceGroupName = 'CreatePubLBQS-rg'
127+
ResourceGroupName = $rg.name
128128
Name = 'myLoadBalancer'
129-
Location = 'eastus'
129+
Location = 'westus2'
130130
Sku = 'Standard'
131131
FrontendIpConfiguration = $feip
132132
BackendAddressPool = $bePool
@@ -169,20 +169,20 @@ Use a NAT gateway to provide outbound internet access to resources in the backen
169169
## Create public IP address for NAT gateway ##
170170
$ip = @{
171171
Name = 'myNATgatewayIP'
172-
ResourceGroupName = 'CreatePubLBQS-rg'
173-
Location = 'eastus'
172+
ResourceGroupName = $rg.name
173+
Location = 'westus2'
174174
Sku = 'Standard'
175175
AllocationMethod = 'Static'
176176
}
177177
$publicIP = New-AzPublicIpAddress @ip
178178
179179
## Create NAT gateway resource ##
180180
$nat = @{
181-
ResourceGroupName = 'CreatePubLBQS-rg'
181+
ResourceGroupName = $rg.name
182182
Name = 'myNATgateway'
183183
IdleTimeoutInMinutes = '10'
184184
Sku = 'Standard'
185-
Location = 'eastus'
185+
Location = 'westus2'
186186
PublicIpAddress = $publicIP
187187
}
188188
$natGateway = New-AzNatGateway @nat
@@ -205,8 +205,8 @@ $bastsubnetConfig = New-AzVirtualNetworkSubnetConfig @bastsubnet
205205
## Create the virtual network ##
206206
$net = @{
207207
Name = 'myVNet'
208-
ResourceGroupName = 'CreatePubLBQS-rg'
209-
Location = 'eastus'
208+
ResourceGroupName = $rg.name
209+
Location = 'westus2'
210210
AddressPrefix = '10.1.0.0/16'
211211
Subnet = $subnetConfig,$bastsubnetConfig
212212
}
@@ -215,16 +215,16 @@ $vnet = New-AzVirtualNetwork @net
215215
## Create public IP address for bastion host. ##
216216
$ip = @{
217217
Name = 'myBastionIP'
218-
ResourceGroupName = 'CreatePubLBQS-rg'
219-
Location = 'eastus'
218+
ResourceGroupName = $rg.name
219+
Location = 'westus2'
220220
Sku = 'Standard'
221221
AllocationMethod = 'Static'
222222
}
223223
$publicip = New-AzPublicIpAddress @ip
224224
225225
## Create bastion host ##
226226
$bastion = @{
227-
ResourceGroupName = 'CreatePubLBQS-rg'
227+
ResourceGroupName = $rg.name
228228
Name = 'myBastion'
229229
PublicIpAddress = $publicip
230230
VirtualNetwork = $vnet
@@ -249,8 +249,8 @@ $rule1 = New-AzNetworkSecurityRuleConfig @nsgrule
249249
## Create network security group ##
250250
$nsg = @{
251251
Name = 'myNSG'
252-
ResourceGroupName = 'CreatePubLBQS-rg'
253-
Location = 'eastus'
252+
ResourceGroupName = $rg.name
253+
Location = 'westus2'
254254
SecurityRules = $rule1
255255
}
256256
New-AzNetworkSecurityGroup @nsg
@@ -283,21 +283,21 @@ $cred = Get-Credential
283283
## Place the virtual network into a variable. ##
284284
$net = @{
285285
Name = 'myVNet'
286-
ResourceGroupName = 'CreatePubLBQS-rg'
286+
ResourceGroupName = $rg.name
287287
}
288288
$vnet = Get-AzVirtualNetwork @net
289289
290290
## Place the load balancer into a variable. ##
291291
$lb = @{
292292
Name = 'myLoadBalancer'
293-
ResourceGroupName = 'CreatePubLBQS-rg'
293+
ResourceGroupName = $rg.name
294294
}
295295
$bepool = Get-AzLoadBalancer @lb | Get-AzLoadBalancerBackendAddressPoolConfig
296296
297297
## Place the network security group into a variable. ##
298298
$ns = @{
299299
Name = 'myNSG'
300-
ResourceGroupName = 'CreatePubLBQS-rg'
300+
ResourceGroupName = $rg.name
301301
}
302302
$nsg = Get-AzNetworkSecurityGroup @ns
303303
@@ -307,8 +307,8 @@ for ($i=1; $i -le 2; $i++){
307307
## Command to create network interface for VMs ##
308308
$nic = @{
309309
Name = "myNicVM$i"
310-
ResourceGroupName = 'CreatePubLBQS-rg'
311-
Location = 'eastus'
310+
ResourceGroupName = $rg.name
311+
Location = 'westus2'
312312
Subnet = $vnet.Subnets[0]
313313
NetworkSecurityGroup = $nsg
314314
LoadBalancerBackendAddressPool = $bepool
@@ -337,8 +337,8 @@ for ($i=1; $i -le 2; $i++){
337337
338338
## Create the virtual machine for VMs ##
339339
$vm = @{
340-
ResourceGroupName = 'CreatePubLBQS-rg'
341-
Location = 'eastus'
340+
ResourceGroupName = $rg.name
341+
Location = 'westus2'
342342
VM = $vmConfig
343343
Zone = "$i"
344344
}
@@ -379,9 +379,9 @@ $ext = @{
379379
Publisher = 'Microsoft.Compute'
380380
ExtensionType = 'CustomScriptExtension'
381381
ExtensionName = 'IIS'
382-
ResourceGroupName = 'CreatePubLBQS-rg'
382+
ResourceGroupName = $rg.name
383383
VMName = "myVM$i"
384-
Location = 'eastus'
384+
Location = 'westus2'
385385
TypeHandlerVersion = '1.8'
386386
SettingString = '{"commandToExecute":"powershell Add-WindowsFeature Web-Server; powershell Add-Content -Path \"C:\\inetpub\\wwwroot\\Default.htm\" -Value $($env:computername)"}'
387387
}
@@ -408,7 +408,7 @@ Use [Get-AzPublicIpAddress](/powershell/module/az.network/get-azpublicipaddress)
408408

409409
```azurepowershell-interactive
410410
$ip = @{
411-
ResourceGroupName = 'CreatePubLBQS-rg'
411+
ResourceGroupName = $rg.name
412412
Name = 'myPublicIP'
413413
}
414414
Get-AzPublicIPAddress @ip | select IpAddress
@@ -423,7 +423,7 @@ Copy the public IP address, and then paste it into the address bar of your brows
423423
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.
424424

425425
```azurepowershell-interactive
426-
Remove-AzResourceGroup -Name 'CreatePubLBQS-rg'
426+
Remove-AzResourceGroup -Name $rg.name
427427
```
428428

429429
## Next steps

0 commit comments

Comments
 (0)