Search code examples
sql-serverlinux.net-coreopenshift

.Net Core App in Openshift linux Pod connecting to SQL Server


I have a .net Core Rest Service deployed in OpenShift which connects to an External SQL Server. I have added the Host Name in the configuration for my namespace. I also have Kerberos setup in a side car

I still have connection errors

my connection string is as follows

 "ConnectionStrings": {
    "SqlDbContext": "Server=ServerXYZ\\InstanceXYZ,55001;Database=myAppDB;Integrated Security=True;
  }

The error I get is

“SqlException: 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

When I run the api from my local windows PC iw works fine, but I am not sure if I need to adapt the connection string for the OpenShift Linux pod


Solution

  • The solution was to use the full domain name of the SQL Server myserver.mydomain.com