How to connect ASP.Net Core to a SQL Server Docker container on Mac How to connect ASP.Net Core to a SQL Server Docker container on Mac docker docker

How to connect ASP.Net Core to a SQL Server Docker container on Mac


I know that @MikePR 's comment serves as the answer, but I wanted to provide a more complete answer for the issue I had. I could not get dotnet ef database commands to execute evan after using the connection string with Trusted_Connection=false. With the help of this article, I was able to use this connection string:

"ConnectionStrings": {    "myCustomConnString": "Server=localhost,1433\\Catalog=myDatabase;Database=myDatabase;User=username;Password=MYSecurePWD;"  }

Now, my migrations run against the SQL Server in the docker container. Note that the article did not include using Trusted_Connection=false. I assume that false is the default.


I got the same issue, and it works simply by deletingTrusted_Connection=True;from the connection string


I ran the connection string as follows and it worked

"ConnectionStrings": {    "DevConnection": "Server=localhost,1433;Database=TarjetaCreditoDB;User Id=sa;Password=myPassw0rd;MultipleActiveResultSets=True;"  }