Skip to content

Commit eca86e2

Browse files
Merge pull request #270685 from mimckitt/patch-118
Update virtual-machine-scale-sets-upgrade-scale-set.md
2 parents e97d10b + 8b81e23 commit eca86e2

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

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

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ Some properties may be changed, with exceptions depending on the current value.
290290
- imageReferenceOffer
291291
- Availability Zones (Preview)
292292
293-
#### Examples
293+
#### Example 1
294294
To update your scale set to use a different OS version, you need to set all the updated properties in a single call. In this example, we are changing from Unbuntu Server 20.04 to 22.04.
295295
296296
```azurecli
@@ -303,6 +303,23 @@ az vmss update \
303303
--set virtualMachineProfile.storageProfile.imageReference.version=latest
304304
```
305305

306+
#### Example 2
307+
To update your scale set to use a different OS version, you need to set all the updated properties in a single call. In this example, we are changing from Windows Server 2016 to Windows Server 2019.
308+
309+
```powershell
310+
$VMSS = Get-AzVmss -ResourceGroupName "myResourceGroup" -VMScaleSetName "myScaleSet"
311+
312+
Set-AzVmssStorageProfile $vmss `
313+
-OsDiskCreateOption "FromImage" `
314+
-ImageReferencePublisher "MicrosoftWindowsServer" `
315+
-ImageReferenceOffer "WindowsServer" `
316+
-ImageReferenceSku "2019-datacenter" `
317+
-ImageReferenceVersion "latest"
318+
319+
Update-AzVmss -ResourceGroupName "myResourceGroup" -Name "myScaleSet" -VirtualMachineScaleSet $VMSS
320+
```
321+
322+
306323
### Properties that require deallocation to change
307324
Some properties may only be changed to certain values if the VMs in the scale set are deallocated. These properties include:
308325

0 commit comments

Comments
 (0)