Closed IDrumsey closed 1 year ago
In the connection string, tcp:
is included to indicate the communication protocol of connection. When supplied via a connection string the protocol is parsed and acted on appropriately. When you provide a config object instead, it needs to be just the hostname you wish to connect to as TCP is implied.
The error you're getting is an internal node error which is self-explanatory - the domain you're trying to connect to is not resolving (ie: there is no DNS entry for it). That's because you're including tcp:
in the server name, which is incorrect.
I can't see any reason you'd expect to combine the protocol with the server name...
Thanks for clarifying. Everywhere I've seen the server name has had the protocol is prepended. If not in the docs, this might be something to add.
Expected behaviour:
Successful connection. I'm trying to connect to an Azure SQL Server database. Reading here, they say to remove the
tcp:
prefix. Is this accurate and if so, why shouldn't we include thetcp:
prefix? It's weird because when I connect with a connection string instead of the config object, it works with "tcp:" in the server name.Actual behaviour:
ConnectionError: Failed to connect to tcp:***.database.windows.net:1433 - getaddrinfo ENOTFOUND tcp:***.database.windows.net
Configuration:
Software versions