I'm having issues authenticating my Azure Windows Server 2019 virtual machine with my AAD user.
According to Microsoft's documentation: https://docs.microsoft.com/en-us/azure/active-directory/devices/howto-vm-sign-in-azure-ad-windows, I've created Azure Windows Server 2019 VM using Terraform and installed Windows AAD authentication extension using:
provisioner "local-exec" {
command = "az vm extension set --publisher Microsoft.Azure.ActiveDirectory --name AADLoginForWindows --resource-group ${data.azurerm_resource_group.RG.name} --vm-name ${var.prefix}"
}
The machine is up and running and the extension installed successfully.

I've also assigned the appropriate role with users and groups in order to log in that VM with AAD authentication.

And ensured that my VMs network configuration permits outbound access over TCP port 443.
However, when trying to log in the VM with RDP and my AAD user (associated with the role) I get the error "The logon attempt failed" as shown above.
I'm trying to RDP Windows 10 VM from Windows 10 Pro VM.

My Windows 10 Pro VM is joined to Azure AD (with my AAD user).

Yet, I get this error when RDP to the other Windows VM from my main Win10Pro VM. When trying to login Linux VMs with AAD authentication everything works as expected.
Running the command "dsregcmd /status" from the Win10Pro VM gave the above output:

Also tried to RDP with "AzureAD\Username@Domain" but git the same credentials error.
What can be the problem? Thanks for the help :)


