0

I referred to below link and succeeded to reset password on VM scale set with extension created Reset password of a virtual machine scale set

Now, I want to reset the password again. However, if I perform the same as above, it will give me an error during Update-AzVmss

Update-AzVmss: On resource 'VMSS1', extension name 'VMAccessAgent' cannot be used for more than one extension.
ErrorCode: BadRequest
ErrorMessage: On resource 'VMSS1', extension name 'VMAccessAgent' cannot be used for more than one extension.
ErrorTarget: 
StatusCode: 400
ReasonPhrase: Bad Request
OperationID : 53c2fea8-bf5a-47fe-a5e9-8e98eea1bb7b

How should I reset the password again? Does it mean I have to remove the extension and run the Powershell script again?

Steve
  • 175
  • 1
  • 3
  • 14

2 Answers2

0

The error you are referring(On VM Scale Set 'VMSS1', extension name 'VMAccessAgent' cannot be used for more than one extension), I suspect this could be related to this one:"Multiple VMExtensions per handler not supported for OS type '{0}'. VMExtension '{1}' with handler '{2}' already added or specified in input."

Understand common error messages when you manage virtual machines in Azure

If the issue still persist, remove the extension and Process password update through script:

$vmss = ""

$vmssResourceGroup = ""

$publicConfig = @{"UserName" = ""}

$privateConfig = @{"Password" = ""}

$extName = "VMAccessAgent"

$publisher = "Microsoft.Compute"

$vmss = Get-AzVmss -ResourceGroupName $vmssResourceGroup -VMScaleSetName $vmssName

$vmss = Add-AzVmssExtension -VirtualMachineScaleSet $vmss -Name $extName -Publisher $publisher -Setting $publicConfig -ProtectedSetting $privateConfig -Type $extName -TypeHandlerVersion "2.0" -AutoUpgradeMinorVersion $true

Update-AzVmss -ResourceGroupName $vmssResourceGroup -Name $vmssName -VirtualMachineScaleSet $vmss

0

I was unable to remove the extension using any PowerShell commands. Ultimately I just deleted it in the portal and then was able to set the extension.

hemisphire
  • 1,205
  • 9
  • 19