Error while connecting .net 5 app with sql server using docker

0

I've been trying to connect .net 5 app with mssql server using docker. I've been always getting this error: Microsoft.Data.SqlClient.SqlException (0x80131904): Login failed for user 'sa'.

This is appsetting.json file:

  "ConnectionStrings": {
  "OrderingConnectionString": "Server=localhost;Database=OrderDb;User 
  Id=sa;Password=SwN@12345678;"
  },

This is docker-compose.yml file:

  orderdb:
    image: mcr.microsoft.com/mssql/server:2017-latest

This is docker-compose.override.yml file

  orderdb:
    container_name: orderdb
    environment:
        SA_PASSWORD: "SwN@12345678"
        ACCEPT_EULA: "Y"
    restart: always
    ports:
     - "1433:1433"

Can anyone help me to solve that?

c#
.net
sql-server
docker
entity-framework
asked on Stack Overflow May 13, 2021 by dragan

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0