I'm deploying my VMs (Ubuntu 22.04 server) using PowerShell and Bicep. When trying to log in after a successful deployment using Bastion, the connection cannot be established. The browser shows the following message: Login failed. Please reconnect and try again.
.
When I take the password that got passed to my template and use it to reset the VM password in the portal and try again, the connection gets established. I believe this rules out any causes based on password policies by Ubuntu or Azure.
Maybe its due to the way I deploy the VMs? I generate two secure passwords using some PowerShell logic. Making sure there's numbers, lower case, upper case and special characters in both the passwords. The passwords get send to the Bicep template as secure objects and accessed in the osProfile
part of the VM description. See example below.
After deployment I do not restart the VMs.
osProfile: {
computerName: 'mountain-${i}'
allowExtensionOperations: true
adminPassword: adminPasswords['vm${i}']
adminUsername: adminUsernames['vm${i}']
linuxConfiguration: {
patchSettings: {
assessmentMode: 'AutomaticByPlatform'
patchMode: 'AutomaticByPlatform'
automaticByPlatformSettings: {
rebootSetting: 'IfRequired'
}
}
}
}