2

I have a SQL Server 2012 instance running on a virtual machine in Azure. I have tried to connect to it using the public virtual IP address; however, I get an error saying:

The server was not found or not accessible

I have checked that the allow remote connection tickbox is checked, and have allowed the .exe through the firewall. I was wondering if it's because I need to add some endpoints to my VM instance through Azure?

Paul White
95.4k30 gold badges440 silver badges689 bronze badges
asked Sep 21, 2015 at 7:38
0

2 Answers 2

3

basic things to check:

  • new firewall inbound rule inside the VM enabling sqlservr.exe. You can make it as restrictive as you want but start with allowing all inbound connections first to verify it works then lockdown one thing at a time
  • new firewall inbound rule inside the VM enabling sqlbrowser.exe. Needed if running named instance.
  • new endpoint for the Azure VM (via Azure portal) to enable SQL Server port. Some users specify some arbitrary unused port for public and SQL Server's default 1433 for private to reduce noise from port scanners that roam the internet looking for common targets. There are pros/cons to this or using default for both. You can decide what's appropriate or talk to your security folks for guidance.
  • TCP/IP enabled for SQL Server, should be enabled by default but takes 30s to verify via Configuration Manager
  • SQL Server enabled for remote access, yes another obvious one but never hurts to verify
answered Sep 21, 2015 at 16:05
1

I've just had the same problem. Hope this might help someone that cannot solve it through any other means found elsewhere:

  • I had two Azure VMs, one for the Web server and one for the SQL Server.
  • Both VMs were in the same virtual network, but each had it's own NSG.

I noticed that even when I was setting up rules in the NSG for the SQL Server VM, the rules defined in the NSG for my other Web server VM still applied.

I resolved it by using only single NSG for the whole virtual network (both VMs) and defining the rules there. But that sure was some unexpected behavior that took me a while to track down.

answered Jan 18, 2017 at 11:58

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.