Symptom:
Unable to RDP to a Virtual Machine Scale Set Instance (VMSS) due to an incorrect password
Resolution:
- If Azure PowerShell is not installed, install it from http://azure.microsoft.com/en-us/downloads/
- Open up PowerShell ISE as an Administrator
- Paste the following script into the Window modifying each of the all CAPS portions:
Login-AzureRmAccount
Get-AzureRmSubscription -SubscriptionId ‘SUBSCRIPTIONID’ | Select-AzureRmSubscription
$vmssName = ‘SCALESETNAME’
$vmssResourceGroup = ‘SCALESETRESOURCEGROUP’
$publicConfig = @{‘UserName’ = ‘USERNAME’}
$privateConfig = @{‘Password’ = ‘NEWPASSWORD.’}
$extName = ‘VMAccessAgent’
$publisher = ‘Microsoft.Compute’
$vmss = Get-AzureRmVmss -ResourceGroupName $vmssResourceGroup -VMScaleSetName $vmssName
vmss = Add-AzureRmVmssExtension -VirtualMachineScaleSet $vmss -Name $extName -Publisher $publisher -Setting $publicConfig -ProtectedSetting $privateConfig -Type $extName -TypeHandlerVersion ‘2.0’ -AutoUpgradeMinorVersion $true
Update-AzureRmVmss -ResourceGroupName $vmssResourceGroup -Name $vmssName -VirtualMachineScaleSet $vmss - Navigate to the Azure Portal and select the VM Scale Set
- Select Instances
- You should see that all the instances are not updated to the Latest Model
- Check all the boxes of the instance you wish you update with the new username and password
- Select Upgrade
- After a few mins (Depending on the number of instances you updated) you should see the Latest Model change to Yes
- You can now login to the Scale Set VMs using the new Username and Password