Accessing SQL Server Container in mac #6269
-
Hi, I'm trying to learn Aspire, and setup a dev environment on my mac where a new SQL server container is spun up. I use this in my apphost. builder.Configuration["Parameters:sql-password"] = "P@$$w0rd1"; My assumption is that I should then be able to connect to this db while it's running in docker desktop using the below, however, I get the error Login failed for user 'sa' suggesting the password isn't being set to P@$$w0rd1 |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 5 replies
-
Localhost doesnt work for the sql server container, use 127.0.0.1 |
Beta Was this translation helpful? Give feedback.
-
Just been checking a few different things, but this works: docker run --name SQL2022 --platform=linux/amd64 I can connect to this no problems. However, when I run this via Aspire: builder.Configuration["Parameters:sql-password"] = "bigS4f3Password"; It doesn't seem to work - sa login fails. I've upgraded the OS and taken latest docker desktop in the past few days - now wondering if something has broken there. |
Beta Was this translation helpful? Give feedback.
-
Latest I think? definitely hitting the database too, as I see this in the log, so for some reason it looks like the password isn't being taken |
Beta Was this translation helpful? Give feedback.
-
Yes, it works! Out of interest, localhost and 127.0.0.1 now both seem to work??? Also, docker shows a different port for the sql server, even though I'm able to connect on 2022. |
Beta Was this translation helpful? Give feedback.
If you delete the volume manually, does it work?