This did not work for me fully, I was getting "Wrong Username / Invalid Credentials". I could get it to work by appending "AzureAD" before the user name like "AzureAD<username>@.onmicrosoft.com". This link helped me: https://www.benday.com/2022/05/17/fix-cant-log-in-to-azure-vm-using-azure-ad-credentials/