Skip to content

Commit f6f93fd

Browse files
Merge pull request #262818 from mbender-ms/lb-ado198522
Load Balancer - configure-vm-scale-set-portal.md - freshness
2 parents 7b217b1 + b541b4e commit f6f93fd

5 files changed

Lines changed: 151 additions & 183 deletions

File tree

.openpublishing.redirection.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12833,6 +12833,17 @@
1283312833
"redirect_url": "/azure/load-balancer/load-balancer-multiple-ip-powershell",
1283412834
"redirect_document_id": false
1283512835
},
12836+
{
12837+
"source_path": "articles/load-balancer/configure-vm-scale-set-cli.md",
12838+
"redirect_url": "/azure/load-balancer/configure-vm-scale-set-portal",
12839+
"redirect_document_id": false
12840+
},
12841+
{
12842+
"source_path": "articles/load-balancer/configure-vm-scale-set-powershell.md",
12843+
"redirect_url": "/azure/load-balancer/configure-vm-scale-set-portal",
12844+
"redirect_document_id": true
12845+
},
12846+
1283612847
{
1283712848
"source_path_from_root": "/articles/dms/tutorial-sql-server-azure-sql-online.md",
1283812849
"redirect_url": "/azure/dms/tutorial-sql-server-to-azure-sql",

articles/load-balancer/TOC.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,8 @@
188188
href: configure-inbound-NAT-rules-vm-scale-set.md
189189
- name: Add multiple Virtual Machine Scale Set instances behind one Azure Load Balancer
190190
href: load-balancer-multiple-virtual-machine-scale-set.md
191-
- name: Use with an existing Azure Load Balancer - Portal
191+
- name: Use Virtual Machine Scale Set instance with an existing Azure Load Balancer
192192
href: configure-vm-scale-set-portal.md
193-
- name: Use with an existing Azure Load Balancer - PowerShell
194-
href: configure-vm-scale-set-powershell.md
195-
- name: Use with an existing Azure Load Balancer - CLI
196-
href: configure-vm-scale-set-cli.md
197193
- name: Upgrade from a basic to standard load balancer
198194
items:
199195
- name: Upgrade options and guidance

articles/load-balancer/configure-vm-scale-set-cli.md

Lines changed: 0 additions & 81 deletions
This file was deleted.

articles/load-balancer/configure-vm-scale-set-portal.md

Lines changed: 139 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
---
2-
title: Configure Virtual Machine Scale Set with an existing Azure Load Balancer - Azure portal
3-
description: Learn how to configure a Virtual Machine Scale Set with an existing Azure Load Balancer using the Azure portal.
2+
title: Configure Virtual Machine Scale Set with an existing Azure Load Balancer - Azure portal/CLI/PowerShell
3+
description: Learn to configure a Virtual Machine Scale Set with an existing Azure standard Load Balancer using the Azure portal, Azure CLI or Azure PowerShell.
44
author: mbender-ms
55
ms.author: mbender
66
ms.service: load-balancer
77
ms.topic: how-to
8-
ms.date: 12/15/2022
8+
ms.date: 01/11/2024
99
ms.custom: template-quickstart, engagement-fy23
1010
---
1111

12-
# Configure a Virtual Machine Scale Set with an existing Azure Load Balancer using the Azure portal
12+
# Configure a Virtual Machine Scale Set with an existing Azure Standard Load Balancer
1313

14-
In this article, you'll learn how to configure a Virtual Machine Scale Set with an existing Azure Load Balancer.
14+
In this article, you'll learn how to configure a Virtual Machine Scale Set with an existing Azure Load Balancer. With an existing virtual network and standard sku load balancer, you can deploy a Virtual Machine Scale Set with a few clicks in the Azure portal, or with a few lines of code in the Azure CLI or Azure PowerShell using the tabs below.
15+
16+
# [Azure Portal](#tab/portal)
1517

1618
## Prerequisites
1719

@@ -23,8 +25,6 @@ In this article, you'll learn how to configure a Virtual Machine Scale Set with
2325

2426
Sign in to the [Azure portal](https://portal.azure.com).
2527

26-
27-
2828
## Deploy Virtual Machine Scale Set with existing load balancer
2929

3030
In this section, you'll create a Virtual Machine Scale Set in the Azure portal with an existing Azure load balancer.
@@ -87,6 +87,138 @@ In this section, you'll create a Virtual Machine Scale Set in the Azure portal w
8787

8888
9. Review the settings and select the **Create** button.
8989

90+
# [Azure CLI](#tab/cli)
91+
92+
## Prerequisites
93+
94+
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
95+
96+
- You need an existing standard sku load balancer in the subscription where the Virtual Machine Scale Set will be deployed.
97+
98+
- You need an Azure Virtual Network for the Virtual Machine Scale Set.
99+
100+
[!INCLUDE [azure-cli-prepare-your-environment-no-header.md](~/articles/reusable-content/azure-cli/azure-cli-prepare-your-environment-no-header.md)]
101+
102+
- This article requires version 2.0.28 or later of the Azure CLI. If using Azure Cloud Shell, the latest version is already installed.
103+
104+
## Deploy a Virtual Machine Scale Set with existing load balancer
105+
106+
Deploy a Virtual Machine Scale Set with [`az vmss create`](/cli/azure/vmss#az-vmss-create).
107+
Replace the values in brackets with the names of the resources in your configuration.
108+
109+
```azurecli-interactive
110+
az vmss create \
111+
--resource-group <resource-group> \
112+
--name <vmss-name>\
113+
--image <your-image> \
114+
--admin-username <admin-username> \
115+
--generate-ssh-keys \
116+
--upgrade-policy-mode Automatic \
117+
--instance-count 3 \
118+
--vnet-name <virtual-network-name> \
119+
--subnet <subnet-name> \
120+
--lb <load-balancer-name> \
121+
--backend-pool-name <backend-pool-name>
122+
```
123+
124+
The below example deploys a Virtual Machine Scale Set with:
125+
126+
- Virtual Machine Scale Set named **myVMSS**
127+
- Azure Load Balancer named **myLoadBalancer**
128+
- Load balancer backend pool named **myBackendPool**
129+
- Azure Virtual Network named **myVnet**
130+
- Subnet named **mySubnet**
131+
- Resource group named **myResourceGroup**
132+
- Ubuntu Server image for the Virtual Machine Scale Set
133+
134+
```azurecli-interactive
135+
az vmss create \
136+
--resource-group myResourceGroup \
137+
--name myVMSS \
138+
--image Canonical:UbuntuServer:18.04-LTS:latest \
139+
--admin-username adminuser \
140+
--generate-ssh-keys \
141+
--upgrade-policy-mode Automatic \
142+
--instance-count 3 \
143+
--vnet-name myVnet\
144+
--subnet mySubnet \
145+
--lb myLoadBalancer \
146+
--backend-pool-name myBackendPool
147+
```
148+
> [!NOTE]
149+
> After the scale set has been created, the backend port cannot be modified for a load balancing rule used by a health probe of the load balancer. To change the port, you can remove the health probe by updating the Azure virtual machine scale set, update the port and then configure the health probe again.
150+
151+
152+
# [Azure PowerShell](#tab/powershell)
153+
154+
## Prerequisites
155+
156+
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
157+
- An existing resource group for all resources.
158+
- An existing standard sku load balancer in the subscription where the Virtual Machine Scale Set will be deployed.
159+
- An Azure Virtual Network for the Virtual Machine Scale Set.
160+
161+
[!INCLUDE [cloud-shell-try-it.md](../../includes/cloud-shell-try-it.md)]
162+
163+
[!INCLUDE [updated-for-az](../../includes/updated-for-az.md)]
164+
165+
## Sign in to Azure CLI
166+
167+
Sign into Azure with [`Connect-AzAccount`](/powershell/module/az.accounts/connect-azaccount#example-1-connect-to-an-azure-account)
168+
169+
```azurepowershell-interactive
170+
Connect-AzAccount
171+
```
172+
173+
## Deploy a Virtual Machine Scale Set with existing load balancer
174+
Deploy a Virtual Machine Scale Set with [`New-AzVMss`](/powershell/module/az.compute/new-azvmss). Replace the values in brackets with the names of the resources in your configuration.
175+
176+
```azurepowershell-interactive
177+
178+
$rsg = <resource-group>
179+
$loc = <location>
180+
$vms = <vm-scale-set-name>
181+
$vnt = <virtual-network>
182+
$sub = <subnet-name>
183+
$lbn = <load-balancer-name>
184+
$pol = <upgrade-policy-mode>
185+
$img = <image-name>
186+
$bep = <backend-pool-name>
187+
188+
$lb = Get-AzLoadBalancer -ResourceGroupName $rsg -Name $lbn
189+
190+
New-AzVmss -ResourceGroupName $rsg -Location $loc -VMScaleSetName $vms -VirtualNetworkName $vnt -SubnetName $sub -LoadBalancerName $lb -UpgradePolicyMode $pol
191+
192+
```
193+
194+
The below example deploys a Virtual Machine Scale Set with the following values:
195+
196+
- Virtual Machine Scale Set named **myVMSS**
197+
- Azure Load Balancer named **myLoadBalancer**
198+
- Load balancer backend pool named **myBackendPool**
199+
- Azure Virtual Network named **myVnet**
200+
- Subnet named **mySubnet**
201+
- Resource group named **myResourceGroup**
202+
203+
```azurepowershell-interactive
204+
205+
$rsg = "myResourceGroup"
206+
$loc = "East US 2"
207+
$vms = "myVMSS"
208+
$vnt = "myVnet"
209+
$sub = "mySubnet"
210+
$pol = "Automatic"
211+
$lbn = "myLoadBalancer"
212+
$bep = "myBackendPool"
213+
214+
$lb = Get-AzLoadBalancer -ResourceGroupName $rsg -Name $lbn
215+
216+
New-AzVmss -ResourceGroupName $rsg -Location $loc -VMScaleSetName $vms -VirtualNetworkName $vnt -SubnetName $sub -LoadBalancerName $lb -UpgradePolicyMode $pol -BackendPoolName $bep
217+
218+
```
219+
> [!NOTE]
220+
> After the scale set has been created, the backend port cannot be modified for a load balancing rule used by a health probe of the load balancer. To change the port, you can remove the health probe by updating the Azure virtual machine scale set, update the port and then configure the health probe again.
221+
90222
## Next steps
91223

92224
In this article, you deployed a Virtual Machine Scale Set with an existing Azure Load Balancer. To learn more about Virtual Machine Scale Sets and load balancer, see:

articles/load-balancer/configure-vm-scale-set-powershell.md

Lines changed: 0 additions & 90 deletions
This file was deleted.

0 commit comments

Comments
 (0)