runtime icon indicating copy to clipboard operation
runtime copied to clipboard

ASP.Net Core 1.1 App running inside docker container cannot connect to Remote Sql Server on Windows

Open rgottumu opened this issue 9 years ago • 6 comments

I have an ASP.Net Core Web API running on .Net Core 1.1 is not able to connect to a sql server which is in my network but outside of docker container. I always get connection time out error.

Connection Timeout Expired. The timeout period elapsed during the post-login phase. The connection could have timed out while waiting for server to complete the login process and respond;

App works fine when running outside of the docker container.

Dockerfile:

FROM microsoft/aspnetcore:1.1 WORKDIR /contest EXPOSE 85 EXPOSE 1433 COPY /out . ENTRYPOINT ["dotnet", "contest.dll"]

any help is appreciated. Thank you.

rgottumu avatar Jun 29 '17 17:06 rgottumu

Did you try to do the same thing in just .NET Core, without ASP.NET Core? (basically minimal repro) It would help us identify where the problem might be.

karelz avatar Jun 29 '17 23:06 karelz

Tried with a .net core console application, same error.

rgottumu avatar Jun 30 '17 19:06 rgottumu

Can you please paste the code?

karelz avatar Jun 30 '17 20:06 karelz

Did you get chance to try .NET Core 2.0 Preview2?

karelz avatar Jun 30 '17 20:06 karelz

sorry for the late reply.. I tested on various environments and finally figured out the root cause. My dev sql instance is still on Sql Server 2008 R2 (RTM). I can connect every instance that I have.

rgottumu avatar Jul 05 '17 01:07 rgottumu

Ok, sounds like this issue can be closed. Thanks!

Petermarcu avatar Jul 07 '17 07:07 Petermarcu