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

  • Whats the issue you are having? – Sam Cogan Sep 15 at 19:38
  • I can't connect externally – Dmitrij Kultasev Sep 15 at 19:43
  • Ok, what error are you getting? – Sam Cogan Sep 15 at 19:44
  • The same error if I wouldn't do anything. Can't connect. Telnet can't connect either – Dmitrij Kultasev Sep 15 at 19:45
  • Just a wild guess, have you double checked that the Windows Firewall allows this connection? – Matthias Güntert Sep 16 at 7:27
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.

| improve this answer | |
  • 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? – Dmitrij Kultasev Sep 17 at 6:13
  • See me updated answer point 5. – Matthias Güntert Sep 17 at 7:30
  • Also ensure Allow remote connections for this server is set from within SSMS – Matthias Güntert Sep 17 at 7:36
  • 1
    See my updated answer. Your source port is set to 1433 but should be 0-65535 – Matthias Güntert Sep 17 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 – Matthias Güntert Sep 18 at 12:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.