0

I created azure vm scale set with custom script extension. After some time I updated custom script extension and wanted to apply changes on each virtual machine on scale set. However nothing is changing. To update VM Scale Set I used Update-AzureRmVmss command in powershell. There is not any error message, command executes successfully

support_ms
  • 1,873
  • 1
  • 18
  • 33

2 Answers2

1

I would say you VMSS is set to update mode manual, so you need to force the node update.

https://learn.microsoft.com/en-us/powershell/module/azurerm.compute/update-azurermvmssinstance?view=azurermps-6.4.0

another thing you are missing: forceUpdateTag. check this: How to force VM created with an ARM template + CustomScriptExtension to redownload the script and run it?

4c74356b41
  • 69,186
  • 6
  • 100
  • 141
1

It sounds like you need to update the "forceUpdateTag" property in the scale set extension profile. You can do this in your ARM template by adding this property at the same level as "publisher" and giving it any value you want (as long as it's different from the previous value). You can also do the same in Powershell and Az CLI using code like the following:

Powershell:

$vmss = Get-AzureRmVmss -ResourceGroupName YOUR_RG_NAME -Name YOUR_VMSS_NAME
    $vmss.VirtualMachineProfile.ExtensionProfile.Extensions[0].ForceUpdateTag="1"
    Update-AzureRmVmss -ResourceGroupName YOUR_RG_NAME -VMScaleSetName YOUR_VMSS_NAME -VirtualMachineScaleSet $vmss

CLI:

    # run the first time
    az vm extension set -g ...

    # run again
    az vm extension set --force-update -g ...

It's a bit complicated in some cases, so I threw together a quick blog post describing it: https://negatblog.wordpress.com/2018/07/11/rerun-extensions-in-azure/

Hope this helps! :) -Neil

Neil Sant Gat
  • 857
  • 6
  • 10