Can Not Connect To Sql Server From Docker Supported Asp.net Core Project
Answer : This took me some time to work out, there are a number of small issues that may be wrong, which makes it frustrating. This can get even more frustrating as the .net core web application visual studio 2017 project that gets auto-generated doesn't work straight out of the box. Having this experience as your first exposure to Docker isn't ideal. I initially also had the incorrect assumption that the docker image would come with SQL Server inside the container, this is not the case, it's trying to access the database server that must be pre-installed on the host machine. Steps to follow (tested for a windows docker image, rather than linux); 1) Get the IP address of your host machine, by running a command prompt and typing IPCONFIG 2) Set the database connection string within you appsettings.json file to this Ip address, followed by the SQL Server port number, i.e.; 192.168.X.X,1433 3) Set the connection string not to use Trusted_Connection (delete thi