Just leaving this here in case this helps someone. In my case of using Visual Studio 2022, while trying to connect to Azure SQL database, I received the error login failed for user "Token-identified principal". This was happening because my ID only have had access to a certain database and looks like if I don't provide any database name in the field "Select the database", it was trying to login to default database using my ID. So all I did was to provide the database name and it worked perfectly. I am using "Azure Directory - Universal with MFA Support" for authentication.