title: SQL Server remote access via Entity Framework
body: <p>There are two physical servers. A managed Linux server (the server on which the application is hosted) and a Windows unmanaged server on which the database is located. I access the database with EF.</p>
  <p>Access to the MS SQL Server database works locally on my computer, as well as on other computers that are in a different network than my home network. However, this only works with debug (localhost hosted).</p>
  <p>The application is not hosted on the standard 443 port but on port 8080 for the time being.</p>
  <p>I have already had the ports opened according to <a href="https://techcommunity.microsoft.com/t5/sql-server-blog/sql-server-ports/ba-p/384096%20this%20tutorial" rel="nofollow noreferrer">this</a>. Open ports TCP 1433, 4022, 1434, UDP 1434. All but 135 were opened. Port 135 could not be opened because quote of the server operator: &quot;Only unprivileged ports are allowed (between 1024 and 65535)&quot;. However, I have not managed to find the reason for the failure.</p>
  <p>Now I wanted to ask if there is a way to connect without this port being open, since port 1433 is supposedly necessary for connecting to an SQL instance.</p>
  <p>I have tried <a href="https://stackoverflow.com/a/16257101/11932313">this</a> as well.</p>
  <p>Are there any other reasons why a connection cannot be established?</p>
  <p>The error message:</p>
  <blockquote>
  <p>An unhandled exception has occurred while executing the request.
  Microsoft.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: 40 - Could
  not open a connection to SQL Server: Could not open a connection to
  SQL Server)</p>
  </blockquote>
  <p>In addition I get this logging information:</p>
  <blockquote>
  <p>Entity Framework Core 6.0.3 initialized  using provider Microsoft.EntityFrameworkCore.SqlServer:6.0.3' with options: None</p>
  </blockquote>
  <p>I have tried it with allowing the ip adress aswell. &quot;Ja&quot; stands for &quot;Yes&quot;.</p>
  <p><a href="https://i.stack.imgur.com/oO3cc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oO3cc.png" alt="I have tried it with allowing the ip adress aswell. Ja stands for Yes" /></a></p>