G
gvdm90
Guest
I have an ASPNET .Core application running on a pod in Kubernetes in AKS. The pod's network is an Azure's private network that is linked to my company's on-premise network via VPN. The web application at runtime connects to different SQL Server DB instances that reside both on the Azure's private network and on the company's on-premise network (I cannot move those on the Azure's network).
The problem that I have is that the web application can access the SQL Server instances that reside on the Azure private network but cannot reach the on-premise's ones. To solve the problems I was thinking to enable a Squid SOCKS proxy on the Azure network that would proxy all the connections to the SQL Servers in the company network. I used this same method to let the application connect to some HTTP services that reside on the company's network using a Squid HTTP proxy, and it's working.
The question is, how to configure the .net core application in order to let it use the SOCKS proxy when using the SqlConnection class? This is how currently I connect to the DBs
using SqlConnection conn = new SqlConnection(connectionString);
conn.Open();
using (SqlCommand command = new SqlCommand(query, conn))
using (SqlDataReader reader = command.ExecuteReader())
{
while (reader.Read())
{
results.Add(tupleHandler(reader));
}
}
Thank you
Continue reading...
The problem that I have is that the web application can access the SQL Server instances that reside on the Azure private network but cannot reach the on-premise's ones. To solve the problems I was thinking to enable a Squid SOCKS proxy on the Azure network that would proxy all the connections to the SQL Servers in the company network. I used this same method to let the application connect to some HTTP services that reside on the company's network using a Squid HTTP proxy, and it's working.
The question is, how to configure the .net core application in order to let it use the SOCKS proxy when using the SqlConnection class? This is how currently I connect to the DBs
using SqlConnection conn = new SqlConnection(connectionString);
conn.Open();
using (SqlCommand command = new SqlCommand(query, conn))
using (SqlDataReader reader = command.ExecuteReader())
{
while (reader.Read())
{
results.Add(tupleHandler(reader));
}
}
Thank you
Continue reading...