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/load-balancer/configure-vm-scale-set-portal.md
+139-7Lines changed: 139 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,19 @@
1
1
---
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.
4
4
author: mbender-ms
5
5
ms.author: mbender
6
6
ms.service: load-balancer
7
7
ms.topic: how-to
8
-
ms.date: 12/15/2022
8
+
ms.date: 01/11/2024
9
9
ms.custom: template-quickstart, engagement-fy23
10
10
---
11
11
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
13
13
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)
15
17
16
18
## Prerequisites
17
19
@@ -23,8 +25,6 @@ In this article, you'll learn how to configure a Virtual Machine Scale Set with
23
25
24
26
Sign in to the [Azure portal](https://portal.azure.com).
25
27
26
-
27
-
28
28
## Deploy Virtual Machine Scale Set with existing load balancer
29
29
30
30
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
87
87
88
88
9. Review the settings and select the **Create** button.
89
89
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.
- 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.
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.
> 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
+
90
222
## Next steps
91
223
92
224
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:
0 commit comments