1
votes

Okay, I am at a complete loss. I have set up a SQL server & database through Azure and have been trying to connect in Visual Studio. The database is listed under Azure in the Server Explorer in Visual Studio, but, when I try to open it in SQL Server Explorer, I get the following error when I try to connect:


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: 0 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.) (Microsoft SQL Server, Error: 10060)


I do not know what else to do. I have opened up port 1433 on my local firewall and allowed access from my computer's IP through the SQL Server's firewall. I temporarily opened it to all ip addresses, which did not work. The SQL Azure says the database is online. Is there an extra step or fix that I missed?

1

1 Answers

1
votes

Connecting to your SQL Database would require you to allow it to be accessible from your IP first.

Please check this MS doc about how to do so.

By default Azure SQL DBs are exposed over the internet just with a simple username/password. Connecting from outside of Azure requires white-listing your IP.

The very simple way to do so is to connect using SQL Management Studio, which detects that and allows you to add you IP address automatically to the firewall rules. Have a look here to see how this works.

Update to include comments:

If none of this works, your problem probably has to do with from where you are trying to access it.

If you are behind a company firewall, there could be rules prohibiting connecting to certain port ranges. Try to connect from a wifi hotspot over your mobile phone is the quickest way to figure out.