5

I created server through docker with command:

docker run -d — name MySQLServer -e ‘ACCEPT_EULA=Y’ -e ‘SA_PASSWORD=your_password123’ -p 1433:1433 mcr.microsoft.com/azure-sql-edge

I'm working on an M1 Mac, and everything works fine. I created test DB and tables. Studio for visualization of my server I use Rider or Azure Data Studio. Both of them are friendly using but I can't get connection string for my DB from both of them. I need it for appSettings in my .NET project. How I can find it? In Visual Studio I found it in properties of DB. Here I don't see such option.

Thom A
  • 88,727
  • 11
  • 45
  • 75
FX_Sektor
  • 1,206
  • 2
  • 14
  • 32

1 Answers1

13

I am also using M1 Mac and SQL Edge coming from this tutorial. In the ASP.NET WebApp the connection string looks something like this:

      "ConnectionStrings": {
          "Default": "Server=localhost; Database=<insert db name>; User Id=sa; Password=your_password123"
      }
monty.py
  • 2,511
  • 1
  • 17
  • 29
  • 3
    If you are getting this error with the previous connection string: `System.Security.Authentication.AuthenticationException: The remote certificate was rejected by the provided RemoteCertificateValidationCallback.` It is because by default Encrypt is set to True, so you will need to add this to the connection string: **Encrypt=False** or **TrustServerCertificate=true**. For more information visit this [issue](https://github.com/dotnet/SqlClient/issues/1402) – Felipe Castro May 11 '22 at 00:00