I have the following docker-compose.yml
:
version: "3.9"
services:
# Database instance
mssql:
image: mcr.microsoft.com/azure-sql-edge:latest
volumes:
- events_mssql:/var/opt/mssql
ports:
- 1433:1433
environment:
- ACCEPT_EULA=1
- MSSQL_SA_PASSWORD=Passw@rd
volumes:
events_mssql:
setup.sql
:
CREATE DATABASE $(MSSQL_DB);
CREATE DATABASE $(MSSQL_DB_AUDIT_LOG);
GO
USE $(MSSQL_DB);
GO
CREATE LOGIN $(MSSQL_USER) WITH PASSWORD = '$(MSSQL_PASSWORD)';
GO
CREATE USER $(MSSQL_USER) FOR LOGIN $(MSSQL_USER);
GO
ALTER SERVER ROLE sysadmin ADD MEMBER [$(MSSQL_USER)];
GO
Here is the running container:
I am trying to connect to the database through the Visual Studio Code extension:
Using this connection string: Server=http://localhost:1433/;Database=master;User Id=sa;Password=Passw@rd;
I am getting the error:
mssql: Error: Unable to connect using the connection information provided. Retry profile creation?
What am I doing wrong here?