An Azure service that is used to provision Windows and Linux virtual machines.
Hi Pavel,
AADSTS293004 comes from Entra, not from the VM. With "Use a web account to sign in", Entra looks up the name you typed in mstsc against the hostnames attribute of the VM's device object, and SERVER-FQDN isn't in that list. Without a primary DNS suffix on the VM, the device usually only has its short computer name there, so the FQDN fails even though DNS resolves correctly. Verifying the domain in the tenant doesn't change that list either. That would also fit with the AAD event log on the VM staying empty, since no token ever reaches the VM.
Two ways around it:
- Connect with the short name exactly as the device shows it under Entra ID > Devices. If your client can't resolve that name, add a hosts file entry pointing it to the VM's IP. If this works, you've confirmed the cause.
- To keep using the FQDN, sign in to the VM with the local account, open System Properties > Computer Name > Change > More..., enter your domain as the primary DNS suffix and reboot. The Device-Sync task then adds the FQDN to the device's hostnames and mstsc works with the FQDN. If the suffix comes from Group Policy or MDM (the PrimaryDnsSuffix setting), fix or remove it there instead.
Someone hit the same error on a fresh Windows 11 VM recently, and adding the DNS suffix was what fixed it: https://learn.microsoft.com/en-us/answers/questions/6033902/unable-to-sign-in-to-microsoft-entra-id-joined-win
For Bastion, retest after the change. If it still fails, make sure you start from the VM's Connect > Bastion page with Microsoft Entra ID selected, since the IP-based Bastion connection doesn't support Entra auth. The Bastion guide below covers the rest.
Docs: