Skip to content

Commit 0421602

Browse files
committed
cli sample instance update
1 parent 76ad65d commit 0421602

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

articles/virtual-machine-scale-sets/virtual-machine-scale-sets-networking.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,19 @@ To add a scale set to the backend pool of an Application Gateway, reference the
8787
### [CLI](#tab/cli1)
8888

8989
```azurecli
90-
$appGWName=<appGwName>
91-
$appGWResourceGroup=<appGWRGName>
92-
$backendPoolName=<backendPoolName>
93-
$backendPoolId=$(az network application-gateway address-pool show --gateway-name $appGWName -g $appGWResourceGroup -n $backendPoolName --query id -otsv)
94-
90+
appGWName=<appGwName>
91+
appGWResourceGroup=<appGWRGName>
92+
backendPoolName=<backendPoolName>
93+
backendPoolId=$(az network application-gateway address-pool show --gateway-name $appGWName -g $appGWResourceGroup -n $backendPoolName --query id -otsv)
94+
95+
vmssName=<vmssName>
96+
vmssResourceGroup=<vmssRGName>
97+
98+
# add app gw backend pool to first nic's first ip config
99+
az vmss update -n $vmssName -g $vmssResourceGroup --add "virtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations[0].ipConfigurations[0].applicationGatewayBackendAddressPools" "id=$backendPoolId"
100+
101+
# update instances
102+
az vmss update-instances --instance-ids * --name $vmssName --resource-group $vmssResourceGroup
95103
```
96104

97105
### [ARM template](#tab/arm1)

0 commit comments

Comments
 (0)