Skip to content

Commit 908d178

Browse files
committed
updates
1 parent 3e3f244 commit 908d178

File tree

2 files changed

+28
-19
lines changed

2 files changed

+28
-19
lines changed

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

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ az vmss extension set \
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
91+
## Apply the extension to the existing scale set instances
9292
Upgrade all the instances to apply the custom script. The upgrade may take a couple of minutes.
9393

9494
```azurecli-interactive
@@ -120,6 +120,17 @@ Enter the public IP address of the load balancer in to a web browser. The load b
120120

121121
Leave the web browser open so that you can see an updated version in the next step.
122122

123+
## Change the upgrade policy
124+
In the previous section, in order to apply the updated application to all the scale set instances, a manual upgrade was needed. To enable updates to be applied automatically to all existing scale set instances, update the upgrade policy from manual to automatic. For more information on upgrade policies, see [Upgrade policies for Virtual Machine Scale Sets](virtual-machine-scale-sets-upgrade-policy.md).
125+
126+
```azurecli-interactive
127+
az vmss update \
128+
--name myScaleSet \
129+
--resource-group myResourceGroup \
130+
--set upgradePolicy.mode=automatic
131+
```
132+
133+
123134
## Update app deployment
124135
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:
125136

@@ -142,14 +153,7 @@ az vmss extension set \
142153
--settings @customConfigv2.json
143154
```
144155

145-
## Apply the updates
146-
Again, upgrade all the instances to apply the custom script. The upgrade may take a couple of minutes.
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.
156+
Because the scale set is now using an automatic upgrade policy, the updated application will automatically be applied to existing scale set instances. Refresh your web browser to see the updated application.
153157

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

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

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Update-AzVmss `
9090
9191
```
9292

93-
## Update the scale set instances
93+
## Add the extension to the existing scale set instances
9494
Perform a manual upgrade to apply the updated extension to all the existing scale set instances. The update may take a couple of minutes to complete.
9595

9696
```azurepowershell-interactive
@@ -150,6 +150,19 @@ Enter the public IP address of the load balancer in to a web browser. The load b
150150

151151
Leave the web browser open so that you can see an updated version in the next step.
152152

153+
## Change the update policy
154+
In the previous section, in order to apply the updated application to all the scale set instances, a manual upgrade was needed. To enable updates to be applied automatically to all existing scale set instances, update the upgrade policy from manual to automatic. For more information on upgrade policies, see [Upgrade policies for Virtual Machine Scale Sets](virtual-machine-scale-sets-upgrade-policy.md).
155+
156+
```azurepowershell-interactive
157+
$vmss = Get-AzVmss -ResourceGroupName "myResourceGroup" -VMScaleSetName "myScaleSet"
158+
159+
Update-Azvmss `
160+
-ResourceGroupName "myResourceGroup" `
161+
-Name "myScaleSet" `
162+
-UpgradePolicyMode "Automatic" `
163+
-VirtualMachineScaleSet $vmss
164+
```
165+
153166
## Update app deployment
154167
Throughout the lifecycle of a scale set, you may 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.
155168

@@ -175,17 +188,9 @@ Update-AzVmss `
175188
-ResourceGroupName "myResourceGroup" `
176189
-Name "myScaleSet" `
177190
-VirtualMachineScaleSet $vmss
178-
179-
Update-AzVmssInstance -ResourceGroupName "myResourceGroup" -VMScaleSetName "myScaleSet" -InstanceId "*"
180-
```
181-
## Apply the update
182-
Perform a manual upgrade to apply the updated extension to all the existing scale set instances. The update may take a couple of minutes to complete.
183-
184-
```azurepowershell-interactive
185-
Update-AzVmssInstance -ResourceGroupName "myResourceGroup" -VMScaleSetName "myScaleSet" -InstanceId "*"
186191
```
187192

188-
All VM instances in the scale set are updated with the latest version of the sample web page. To see the updated version, refresh the web site in your browser:
193+
Because the scale set is now using an automatic upgrade policy, the updated application will automatically be applied to existing scale set instances. Refresh your web browser to see the updated application. To see the updated version, refresh the web site in your browser:
189194

190195
![Updated web page in IIS](media/tutorial-install-apps-powershell/running-iis-updated.png)
191196

0 commit comments

Comments
 (0)