Skip to content

Commit b232660

Browse files
Merge pull request #107861 from maulikshah23/patch-8
Update virtual-machine-scale-sets-automatic-upgrade.md
2 parents a9fca51 + bae73a7 commit b232660

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

articles/virtual-machine-scale-sets/virtual-machine-scale-sets-automatic-upgrade.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,57 @@ az vmss update --name myScaleSet --resource-group myResourceGroup --set UpgradeP
186186
> [!NOTE]
187187
>After configuring automatic OS image upgrades for your scale set, you must also bring the scale set VMs to the latest scale set model if your scale set uses the 'Manual' [upgrade policy](virtual-machine-scale-sets-upgrade-scale-set.md#how-to-bring-vms-up-to-date-with-the-latest-scale-set-model).
188188
189+
### ARM templates
190+
The following example describes how to set automatic OS upgrades on a scale set model via Azure Resource Manager templates (ARM templates):
191+
192+
```json
193+
"properties": {
194+
"upgradePolicy": {
195+
"mode": "Automatic",
196+
"RollingUpgradePolicy": {
197+
"BatchInstancePercent": 20,
198+
"MaxUnhealthyInstancePercent": 25,
199+
"MaxUnhealthyUpgradedInstancePercent": 25,
200+
"PauseTimeBetweenBatches": "PT0S"
201+
"automaticOSUpgradePolicy": {
202+
"enableAutomaticOSUpgrade": true,
203+
"useRollingUpgradePolicy": true,
204+
"disableAutomaticRollback": false
205+
}
206+
}
207+
"imagePublisher": {
208+
"type": "string",
209+
"defaultValue": "MicrosoftWindowsServer"
210+
},
211+
"imageOffer": {
212+
"type": "string",
213+
"defaultValue": "WindowsServer"
214+
},
215+
"imageSku": {
216+
"type": "string",
217+
"defaultValue": "2022-datacenter"
218+
},
219+
"imageOSVersion": {
220+
"type": "string",
221+
"defaultValue": "latest"
222+
}
223+
}
224+
```
225+
226+
### Bicep
227+
The following example describes how to set automatic OS upgrades on a scale set model via Bicep:
228+
229+
```json
230+
properties: {
231+
    overprovision: overProvision
232+
    upgradePolicy: {
233+
      mode: 'Automatic'
234+
      automaticOSUpgradePolicy: {
235+
        enableAutomaticOSUpgrade: true
236+
      }
237+
    }
238+
```
239+
189240
## Using Application Health Probes
190241

191242
During an OS Upgrade, VM instances in a scale set are upgraded one batch at a time. The upgrade should continue only if the customer application is healthy on the upgraded VM instances. We recommend that the application provides health signals to the scale set OS Upgrade engine. By default, during OS Upgrades the platform considers VM power state and extension provisioning state to determine if a VM instance is healthy after an upgrade. During the OS Upgrade of a VM instance, the OS disk on a VM instance is replaced with a new disk based on latest image version. After the OS Upgrade has completed, the configured extensions are run on these VMs. The application is considered healthy only when all the extensions on the instance are successfully provisioned.

0 commit comments

Comments
 (0)