I have an Azure SQL server to which I need to connect via SSMS using some Azure AD user. [Azure Active Directory authentication only feature is enabled]
The admin of the Azure SQL server instance is the Service Principal, with the help of which I add the necessary AD user during the creation and configuration of the Azure SQL server/database.
Then I tried to connect to the database using this added user and getting following error:
Cannot connect to XXXXXX.database.windows.net.
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.) (.Net SqlClient Data Provider)
Error Number: 10060; Severity: 20; State: 0
I tried to connect to the Azure SQL database via portal and run some queries in Query editor with the same AD user, it is working perfectly.
I've checked an access to the database for my user using this query:
SELECT name as username, type_desc as type FROM sys.database_principals
And my AD user is there as an EXTERNAL_USER.






