I have 2 containers:
- database (
azuresqledge
) - application (
my-dbup-app
- .NET 6.0)
I can access the database container from my host machine and run the .NET application from my host machine via localhost.
When I try to run the application via Docker, the application cannot find the SQL Server instance.
Server=azuresqledge;Database=databasename;User Id=sa;password=pwd;Trusted_Connection=False;MultipleActiveResultSets=true;
System.Data.SqlClient.SqlException (0x80131904): 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: 35 - An internal exception was caught)
I made sure that both are running on the same Docker Network - bridge
- so that I just need to set the connection string to be the container's name, however the application fails to connect.
I am running on Mac M1 so need to use azuresqledge.
Is there something I'm missing in the configuration?
Thanks.