I have an API hosted in GCP Cloud Run trying to connect to on-prem SQL Server via Entity Framework with a connection string. The Cloud Run instance is on a VPC that is connected to our network. We have tested a ping to the server with python code on another Cloud Run instance also on the VPC and it is able to communicate with the SQL Server this way but for some reason the .NET C# code is having issue. Does anyone have any thoughts? I’d appreciate your help. Thanks.
Below is the error message that I’m getting.
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: 40 – Could not open a connection to SQL Server)
Have tried connection string with FQDN, IP, IP + Port with all the same result. Have tried every configuration available in GCP to no avail.
Will Hess is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.