kelvinmac
kelvinmac

Reputation: 301

Visual Studio Azure SQL Server: no connection could be made because the target machine actively refused it

I'm trying to connect to a SQL Server database that's being hosted on Azure, I'm using the server explorer to select my Azure account, then the SQL Server; I right click and select "Open in SQL Server Object Explorer" after which I'm prompted to enter the password.

I'm unable to go past this step as I've been getting this error (see screenshot) ever since creating the server. I've added my IP address to the SQL Server's firewall.

I've even tried connecting to it with my firewall off but I get the same error.

enter image description here

Upvotes: 2

Views: 3983

Answers (3)

dscarf
dscarf

Reputation: 34

You need to get your IPv4 address by pulling up Command Prompt and typing in ipconfig. Then go to your azure database and configure the firewall settings. Next add a client by creating a new client name and adding the IP address you got from your computer. This will allow your computer to access your database. It also lets you create a range for your IP address which I recommend doing.

Upvotes: 0

kelvinmac
kelvinmac

Reputation: 301

I managed to fix the problem, it turns out the network(eduroam) at my university was the problem. I don’t understand how or why they’d want to block Azure; but using a proxy or a mobile hotspot connects me immediately without any errors.
Thanks you all for trying to help.

Upvotes: 1

Alberto Morillo
Alberto Morillo

Reputation: 15648

You can open Visual Studio from within Azure Portal and you will be automatically connected to your Azure databases. Please see image below.

enter image description here

Upvotes: 0

Related Questions