Skip to content

Commit 1edad95

Browse files
committed
Update tutorial-install-apps-cli.md
1 parent 52bc890 commit 1edad95

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

articles/virtual-machine-scale-sets/tutorial-install-apps-cli.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ In your current shell, create a file named *customConfig.json* and paste the fol
4444
}
4545
```
4646

47+
> [!NOTE]
48+
> You may need to invert the use of the single (') and double quotes (") within the JSON block if you decide to reference the JSON directly (instead of referencing the *customConfig.json* file) in the *--settings* parameter below.
49+
4750
## Create a scale set
4851

4952
> [!IMPORTANT]
@@ -63,7 +66,6 @@ az vmss create \
6366
--name myScaleSet \
6467
--image Ubuntu2204 \
6568
--orchestration-mode Flexible \
66-
--upgrade-policy-mode Automatic \
6769
--admin-username azureuser \
6870
--generate-ssh-keys
6971
```
@@ -83,13 +85,18 @@ az vmss extension set \
8385
--settings customConfig.json
8486
```
8587

86-
Each VM instance in the scale set downloads and runs the script from GitHub. In a more complex example, multiple application components and files could be installed. If the scale set is scaled up, the new VM instances automatically apply the same Custom Script Extension definition and install the required application.
87-
8888
> [!CAUTION]
8989
> File names are case sensitive. Use the exact file name stated in these instructions to avoid failure.
9090
91+
## Update your scale set instances
92+
To apply the custom script to all existing instances, perform a manual upgrade.
93+
94+
```azurecli-interactive
95+
az vmss update-instances --resource-group myResourceGroup --name myScaleSet --instance-ids "*"
96+
```
97+
9198
## Allow traffic to port 80
92-
To allow traffic to the application, add a network security group rule.
99+
To allow traffic to flow through the load balancer to the virtual machines the default network security group needs to be updated.
93100

94101
```azurecli-interactive
95102
az network nsg rule create --name AllowHTTP --resource-group myResourceGroup --nsg-name myScaleSetNSG --access Allow --priority 1010 --destination-port-ranges 80
@@ -114,8 +121,6 @@ Enter the public IP address of the load balancer in to a web browser. The load b
114121
Leave the web browser open so that you can see an updated version in the next step.
115122

116123
## Update app deployment
117-
Throughout the lifecycle of a scale set, you might need to deploy an updated version of your application. With the Custom Script Extension, you can reference an updated deploy script and then reapply the extension to your scale set. When the scale set was created in a previous step, the `--upgrade-policy-mode` was set to *automatic*. This setting allows the VM instances in the scale set to automatically update and apply the latest version of your application.
118-
119124
In your current shell, create a file named *customConfigv2.json* and paste the following configuration. This definition runs an updated *v2* version of the application install script:
120125

121126
```json
@@ -125,7 +130,7 @@ In your current shell, create a file named *customConfigv2.json* and paste the f
125130
}
126131
```
127132

128-
Apply the Custom Script Extension configuration to the VM instances in your scale set again with [az vmss extension set](/cli/azure/vmss/extension). The *customConfigv2.json* is used to apply the updated version of the application:
133+
Apply the Custom Script Extension configuration to the your scale set again with [az vmss extension set](/cli/azure/vmss/extension). The *customConfigv2.json* is used to apply the updated version of the application:
129134

130135
```azurecli-interactive
131136
az vmss extension set \
@@ -137,7 +142,14 @@ az vmss extension set \
137142
--settings @customConfigv2.json
138143
```
139144

140-
Refresh your web browser to see the updated messaging.
145+
## Update your scale set instances
146+
To apply the updated custom script to all existing instances, perform a manual upgrade.
147+
148+
```azurecli-interactive
149+
az vmss update-instances --resource-group myResourceGroup --name myScaleSet --instance-ids "*"
150+
```
151+
152+
Refresh your web browser to see the updated application.
141153

142154
![Updated web page in Nginx](media/tutorial-install-apps-cli/running-nginx-updated.png)
143155

0 commit comments

Comments
 (0)