0
  1. I am using a service account (AD account sync’d with Azure AD) to connect to Azure SQL DB (Note: SQL account connection works but need AD account to work)
  2. Service account (abc@xyz.com) has ‘Read/Write’ access on Azure SQL DB
  3. Service account connection works from (SQL studio) SSMS.

I am getting "Microsoft SQL: Cannot open server '@xyz.com' requested by the login. The login failed" error. I don't understand what I am I doing wrong here. The account has been created in DB, it has access and still it doesn't connect.

enter image description here

enter image description here

enter image description here

shazufaraz
  • 59
  • 8
  • Please turn "Allow azure services and resources to access this server" setting to "Yes" and let me know if it works for you. Follow the path: SQL Server -> Security -> Firewall and virtual networks -> Allow azure services and resources to access this server -> Yes. Also make sure that your IP address is whitelisted. – Utkarsh Pal Jul 12 '21 at 08:22

1 Answers1

0

That server name is too short to be an Azure SQL Database.

It should be something like name.database.windows.net

Francesco Mantovani
  • 10,216
  • 13
  • 73
  • 113
  • I do have the server that follows name.database.windows.net. Still it throws same error. – shazufaraz Jul 09 '21 at 13:38
  • It looks too short to me https://snipboard.io/m7t6V4.jpg – Francesco Mantovani Jul 09 '21 at 14:24
  • Made a change - I was trying to use Database authentication so far and getting login failed error. I switched the authentication mode to 'Windows'. Now, I am getting a new error message. [Error Details: "Microsoft SQL: 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 - No such host is known.)"]. Is this Firewall related? If so, what needs to be enabled? – shazufaraz Jul 09 '21 at 21:50
  • Try to connect to the same database through SSMS form the same machine. Let me know – Francesco Mantovani Jul 11 '21 at 07:15
  • As mentioned in the question, the connection works from SSMS. – shazufaraz Jul 11 '21 at 18:01