0
votes

How do I remove custom script extension from a Azure scale set using powershell. the below script runs without any error but the extension is till there. Is something still missing?

# Get information about the scale set
$vmss = Get-AzureRmVmss `
                -ResourceGroupName $ResourceGroup `
                -VMScaleSetName $ScaleSet

Remove-AzureRmVmssExtension -VirtualMachineScaleSet $vmss -Name "customScript"
Update-AzureRmVmssInstance -ResourceGroupName $ResourceGroup -VMScaleSetName $scaleSetName -InstanceId "*"
1
Is wildcard for instance ID supported? I do not see it in the documentation: docs.microsoft.com/en-us/powershell/module/azurerm.compute/…. Also how do you determine that extension is still there? - Alex S
Please try running Update-AzureRmVmss after Remove-AzureRmVmssExtension and before Update-AzureRmVmssInstance - Alex S

1 Answers

0
votes

$vmss = Get-AzureRmVmss -ResourceGroupName $RGName -VMScaleSetName $vmssName

Remove-AzureRmVmssExtension -VirtualMachineScaleSet $vmss -Name $vmssExtensionName

Update-AzureRmVmss -ResourceGroupName $RGName -Name $vmssName -VirtualMachineScaleSet $vmss