Unable to Reset the Password in Scale Set

Ashen Ranaweera 0 Reputation points
2024-05-10T09:58:18.7066667+00:00

When I'm trying to reset the password from the Azure portal it's giving following error,

Reset password for virtualMachineScaleSets 'abcapsoprdvmss' failed with error: VM has reported a failure when processing extension 'enablevmAccess' (publisher 'Microsoft.Compute' and type 'VMAccessAgent'). Error message: 'Cannot update Remote Desktop Connection settings for Administrator account. Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException: The password does not meet the password policy requirements. Check the minimum password length, password complexity and password history requirements. --- End of inner exception stack trace --- at System.DirectoryServices.DirectoryEntry.Invoke(String methodName, Object[] args) at Microsoft.WindowsAzure.GuestAgent.Plugins.WindowsUser.SetPassword(SecureString password, Boolean expirePassword) at Microsoft.WindowsAzure.GuestAgent.Plugins.RemoteAccessAccountManager.AddOrUpdateRemoteUserAccount(String userName, SecureString password, Boolean expirePassword) at Microsoft.WindowsAzure.GuestAgent.Plugins.JsonExtensions.VMAccess.VMAccessExtension.OnEnable()'. More information on troubleshooting is available at https://aka.ms/vmextensionwindowstroubleshoot.

But I don't think there is an issue with the password what I gave. Because the given password is fulfilling the requirements. Any solution for this error?

Azure Virtual Machine Scale Sets
Azure Virtual Machine Scale Sets
Azure compute resources that are used to create and manage groups of heterogeneous load-balanced virtual machines.
407 questions
{count} votes

1 answer

Sort by: Most helpful
  1. vipullag-MSFT 26,316 Reputation points
    2024-05-13T05:35:21.8966667+00:00

    Hello Ashen Ranaweera

    Welcome to Microsoft Q&A Platform, thanks for posting your query here.

    The error message indicates that the password you provided does not meet the password policy requirements.
    If you are sure that the password meets the requirements, you can try resetting the password using the VM access extensions.

    Here is an example for resetting VMSS password using PowerShell:

    $vmssName = "myvmss"

    $vmssResourceGroup = "myvmssrg"

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

    $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

    Here is an example for resetting VMSS password using CLI:

    az vmss extension set --resource-group myResouceGroup --vmss-name myScaleSet --publisher Microsoft.OSTCExtensions --name VMAccessForLinux --version 1.5 --protected-settings "{'username': 'newUser', 'password': 'newPassword'}"

    Ref: https://learn.microsoft.com/en-us/azure/virtual-machine-scale-sets/virtual-machine-scale-sets-faq#how-do-i-reset-the-password-for-vms-in-my-virtual-machine-scale-set-

    Hope this helps.
    If the suggested response helped you resolve your issue, please 'Accept as answer', so that it can help others in the community looking for help on similar topics.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.