0

I want to allow TCP connection to 1433 port (SQL Server) on the Azure Windows Virtual Machine. TCP is enabled for SQL Server and I can telnet to this port from the local machine as well (telnet localhost 1433).

Inbound rule in Windows firewall

enter image description here

Inbound rule in Azure portal

enter image description here

What should I do more to be able to connect externally?

UPDATE:

Network effective security rules

enter image description here

Networking

enter image description here

SQL Server

enter image description here enter image description here enter image description here enter image description here

8
  • Whats the issue you are having? Commented Sep 15, 2020 at 19:38
  • I can't connect externally Commented Sep 15, 2020 at 19:43
  • Ok, what error are you getting? Commented Sep 15, 2020 at 19:44
  • The same error if I wouldn't do anything. Can't connect. Telnet can't connect either Commented Sep 15, 2020 at 19:45
  • Just a wild guess, have you double checked that the Windows Firewall allows this connection? Commented Sep 16, 2020 at 7:27

1 Answer 1

2

A word of warning: Opening up 1433/TCP to the internet (with source: Any) is quite a security risk. Think twice about your intentions here!

  1. Install SSMS on the mentioned VM and ensure that you can connect locally to your MSSSQL server. Also ensure that Allow remote connections to this server is ticked (in SSMS go to the properties of your server > Connections > Remote server connections).

  2. Double check that your local windows firewall allows the connection (not NSG! turn of the windows firewall entirely for testing)

  3. Check if a NSG attached to the subnet may blocks your connection

  4. Use the IP flow tool provided by Network Watcher to verify your connectivity
    https://docs.microsoft.com/en-us/azure/network-watcher/network-watcher-ip-flow-verify-overview

  5. Double check if by any chance you have more than one NIC attached to the VM and that ACLs apply to the correct/expected NIC

  6. Have a look at the Effective Security Rules (VM > Networking > Effective Security Rules)

==> It seems your source port is set to 1433/TCP but really should be 0-65535.

7
  • The connectivity tool said that it is blocked by "DenyAllBound" rule (please check img in question). My question would be, how the RDP is working then and is not blocked, but SQL Server rule is blocked? Commented Sep 17, 2020 at 6:13
  • See me updated answer point 5. Commented Sep 17, 2020 at 7:30
  • Also ensure Allow remote connections for this server is set from within SSMS Commented Sep 17, 2020 at 7:36
  • 1
    See my updated answer. Your source port is set to 1433 but should be 0-65535 Commented Sep 17, 2020 at 9:11
  • 1
    Usually the client selects a random source port from a range of ports and not one specific port, see en.wikipedia.org/wiki/Ephemeral_port for more information Commented Sep 18, 2020 at 12:25

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.