Azure - Network Path Not Found - sql-server

I have 4 Azure VMs which are part of the same resource group and virtual network. 3 of them are running SQL Sever and 1 of them is configured as a domain controller. The 3 SQL VMs are getting there DNS from the DC.
The VMs can log into the domain and see each other on the network. When I try to use connect to SQL instances across the virtual network, however, I receive a network path not found error.
I have renamed the instances and even tried removing and re-installing them. So I am sure it is a network issue, and not a SQL Server problem. I also can't connect via IP address, so it doesn't seem to be DNS.
The instances are all default instances and are connected on 1433, the VMs all have TCP 1433 endpoints and Windows Firewall is turned off.

I think you need to Enable the Port from Azure Services As well

The instances are all default instances and are connected on 1434, the
VMs all have TCP 1433 endpoints, and Windows Firewall is turned off.
Ensure you have both ports open in all machines. 1433, 1434
Also remember that disable windows firewall is just a temporary thing, you should re-enable it once the connection test pass.
Note that depending of your kind of connection/services you also should open:
1433: / TCP / UDP
80: For sync over HTTP / TCP
443: SQL Server default instance running over an HTTPS endpoint / TCP
4022: Service Broker / TCP
135: Transact-SQL debugger / TCP
7022: Defacto database mirroring / TCP
2383: SQL Server Analysis Services
2382: connection requests to a named instance of Analysis Services

Related

Cannot connect to Azure VM with SQL Server

I cannot get my Azure VM with SQL Server to connect from anything other than the local machine. This is a Windows VM where I downloaded and installed SQL Server manually. I am at a loss.
If I RDP to the machine and connect to SQL Server it succeeds. If I attempt to hit it from any other box on my Virtual Network it will not connect. I can ping the box and the name resolves to the proper IP address. Test-NetConnection shows that I cannot connect on port 1433, but I can connect on other ports like 3389.
Here is all I've tried/confirmed thus far.
TCP/IP is enabled in configuration manager and set to listen on port 1433. Remote access is enabled in configurations.
I added a port 1433 Windows firewall rule for all 3 profiles.
I turned off the Windows firewall for all 3 profiles.
Confirmed both machines are definitely on the same virtual network.
The default NSG rule is in place for any port/protocol on the same Virtual Network.
I added an explicit NSG rule for the source IP of another machine to any port/protocol.
I modified the rule that allowed me to RDP to the box from my personal IP to include 1433 in addition to 3389. Test-NetConnection succeeds on 3389 and fails on 1433.
None of these made a difference.
I created a new VM where the machine came pre-installed with SQL Server. It connects just fine from any other machine on the VirtualNetwork without making any changes to any firewall or NSG rules.
What am I missing?
Is SQL listening on the internal address and an allowed connection IP? http://www.mohamedmostafa.co.uk/blog/2009/10/10/setup-configure-microsoft-sql-server-to-allow-remote-connection-remote-sql-management-studio-access/
Sound like your MSSQL is setup with a dynamic port in the tcp/ip protocol. Check the TCP/IP protocol and if the port is blank, set it to the desired port (1433) and set NSG to allow communication on this port.

What is the secret to connecting remotely to SQL Server running on a Google Cloud VM?

I have a Google Cloud VM running Windows Server 2016 Datacenter with SQL Server 2017 installed.
I am using SSMS 2017 as my client, both locally and remotely.
I can RDP to the VM.
I can ping the IP of the VM.
I disabled the firewall on the VM.
I set the database to allow SQL Server authentication.
The SQLBrowser service is running in the server.
There are firewall settings on the Google Dashboard and I opened ports 1433, 1434 TCP and UDP on the project, nothing changed.
I can connect to the SQL Server instance with the same credentials using the same client running locally on the VM.
When I run PortQry it tells me ports 1434 and 1433 are FILTERED even though the firewall is disabled. That confuses me, maybe I don't understand the output of PortQry.
I get this error when I use the server\instance to connect remotely:
If I just use the server name I get this error:
Here is the firewall setting:
I had same issue and I overcome with following settings with following GCP Firewall rules.
There is no need to disable firewall in GCP VM instance, better keep it on. To access your instance using SQL server management studio within your GCP VM's external IP address, you also need to add it in GCP network firewall rules too.
Name, Type, Targets, Filters, Ports, Action, Priority, Network
rulename1, Ingress, Apply to all, IP ranges: gcp external IP here, all, Allow, 900, default (For GCP VMs External IP Address)
rulename2, Ingress, Apply to all, IP ranges: your remote IP here, tcp:1433, Allow, 900, default (For Remote Server or Development Server IP Address)
There is no need to allow Edge traversal at all.
Hope this will help someone.
I have the same problem with you.
You should use the same Networks tags of your VM machine in the Firewall rules settings.
Your VM machine tags
Firewall rules
Before, I set the targets to "Apply to all" and it didn't work.
A little awkward!

Unable to telnet to SQL mirroring port on public IP on Azure ARM VM

I am trying to mirror a on premise SQL database to Azure ARM VMs running SQL server. One for the mirror and one for the witness. I have setup the mirroring end points on the servers. However, I am getting an error to the effect that the mirror server can not be reached.
Reading through the net pages, I tested the port using telnet. I am able to telnet to the mirroring port on my local server from the Azure VM but unable to telnet from the local server to the VMs.
I am able to telnet on the mirroring port between the VMs using the Private IP Address but unable to do so using the Public IP address.
I have added the port to the Security group being used by these VMs to allow inbound connections as well as outbound connections.
I have tested that the server is listening on ip 0.0.0.0 and my mirroring port.
Any help would be very much appreciated.
For whatever its worth, I was setting the Inbound connections source port range as the port I was going to use for mirroring. I changed this to "*" and it started working.

Connecting to a 2014 SQLEXPRESS database on an externally hosted computer through TCP/IP

I am working on a system whereby I can update a small database from several locations. I wish to host the database on my home computer and allow connections to be made to the database from two other locations through tcp/ip.
I have done the following thus far:
Enabled TCP/IP for SQLEXPRESS
Allowed port 1433 tcp on my firewall
Allowed port 1434 udp on my firewall
Enabled SQLEXPRESS server to allow remote connections
I was hoping to be able to connect to the database by opening sql management studio on the other pcs and using the following format [ExternalIP]\SQLEXPRESS but as of yet I have been unable to do so. I have looked at what my external IP might be and i am getting two different values:
86.XX.X.XXX
66.XXX.XX.XX
Should I be using either of these values with this format to connect from the other sql management studios when everything has been correctly configured? Are there any steps that I am missing?
Named instances of SQL Server don't listen by default on port 1433, but instead on a random port determined at each service startup. It's the function of the sql browser service to provide clients with actual ports of each running instance (and that's done using the fixed 1434 udp port).
The necesary steps would be to configure the server to use a fixed port, then setup the firewall and router to allow that port. When connecting, just use the external IP address with the port but not the instance name (as that would invoke the browser service, which is unneeded with fixed ports).
To resume, necesary steps would be these:
Enable remote connections on the server.
Setup users and permissions as needed (Windows authentication is a pain over internet, so SQL authentication is strongly recommended)
Enable TCP/IP for the instance.
Configure the server to use a fixed port for connections (1433 being the standard). Look here for instructions.
Restart the database server.
Give permissions on the firewall to allow the server executable incoming connections on your selected port. At this point other computers in the LAN should connect.
On your router forward the port you opened to your local machine private IP (note that in Windows you must configure your computer to use a fixed local IP instead of DHCP).
Test with a client over internet or just using your external IP.
Note that for the connection from the remote client, as server name you must use 86.XX.X.113,1433 (the port number is separated with a comma, optional if it's 1433). Notice that there is NO instance name, even if you installed it as SQLEXPRESS or whatever. This is due having a fixed listening port (like the default instance by default). That eliminates the need of the browser service and udp 1434, and the pain of a dynamic port forwarding.
You should also check that your ISP most likely will give you a dynamic external IP, so clients might be reconfigured when that changes. Or you can use some dynamic DNS service.
Config MSSQL Express 2014 connect remoto PC or PHP, etc..
View Video Tutorial Easy Config Server to MSSQL Express:
https://www.youtube.com/watch?v=5UkHYNwUtCo
Code Test Cliente Remote PHP:
$serverName = '192.168.1.64,49170'; //only the server name and ip MSSQL SERVER EXPRESS
$connectionInfo = array( "Database"=>"mydbName", "UID"=>"myUserId", "PWD"=>"myPass");
$conn = sqlsrv_connect( $serverName, $connectionInfo);
if( $conn ) {
echo "Connection established";
}else{
echo "Connection could not be established.";
die( print_r( sqlsrv_errors(), true));
}

Cannot Connect To SQL Within Azure Network

I am having a real hard time establishing SQL connection between servers within a Azure network. The really odd thing is that I can connect to SQL from my home machine which is outside the VM network. It seems like some type of network issue from within the VM domain which I have not been able to identify yet.
My configuration is as follows:
I have three VM's (Active Directory, Sql Server, and an App Server)
I am trying to establish SQL connection from app server to sql server
Both VM's Windows Server 2012
All servers are on the same azure network, affinity group, domain
All servers connected to the domain and have IP's
I can see DNS is resolving because I can ping the sql server from the app server using the sql server's computer name
I created Firewall rules allowing in/out on port 1433 on both servers
SQL Server is listening on the default port because of this command executed on the SQL Server (i'm not understanding the 0.0.0.0 IP though which may be a problem) (I can connect from home so I think this is ok)
netstat -an | find ":1433"
TCP 0.0.0.0:1433 0.0.0.0:0 LISTENING
TCP [::]:1433 [::]:0 LISTENING
I created public & private endpoints on SQL for default sql port 1433
I can actually connect to SQL Server from my home machine
I have temporarily turned off firewalls on both servers
tracert from the app server looks like this.
tracert spsql01
Tracing route to spsql01 [10.0.0.7]
over a maximum of 30 hops:
1 * * * Request timed out.
2 * * * Request timed out.
3 * * * Request timed out.
4 5 ms <1 ms 1 ms spsql01 [10.0.0.7]
Trace complete.
On the App Server i create a connection.udl file to test the connection to my SQL Server but it never passes the connection test.
Have you created the appropriate Windows Azure SQL Database firewall rules for your VMs in Windows Azure? You can use either the special 0.0.0.0 for all of Windows Azure or, better, provide the public VIP of your IaaS cloud service (not the private DIP of the individual VMs). The latter limits firewall access to only your cloud service, since the outbound connection to WASD will use your public VIP. Note that if you delete (or stop/deallocate) all the VMs in your cloud service you will lose the VIP.

Resources