Scott
Scott

Reputation: 3732

Connect to SQL Server database on Azure through a proxy server

I'm trying to access my Microsoft Azure service through Visual Studio Community (v12 update 4) through a corporate proxy server. I'm able to access my mobile services and the API scripts using proxy settings I manually entered into the .config file (http://en.code-bude.net/2013/07/15/how-to-setup-a-proxy-server-in-visual-studio-2012/)

However I can't get into my SQL Server databases through Visual Studio or the included SQL Server Object Explorer. I get the following error:

Cannot connect to mydb.database.windows.net.

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: Named Pipes 
Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 53)

FWIW I also cannot connect to the SQL database through SQL Server Management Studio via the proxy at work, although I can do it from home. The web database access through Azure's management portal has stopped working for a few months now - giving me a blank page when logged in, so I'm pretty much shut out of db access.

I do not have access to my corporate proxy server. It's run by bureaucrats who answer to their own silo.

Anyone else successfully connect to the SQL Server db through a proxy?

Upvotes: 3

Views: 14129

Answers (2)

BrentDaCodeMonkey
BrentDaCodeMonkey

Reputation: 5513

With Azure SQL DB v12, you can do this but need to make sure that the database's connection policy is set to "proxy". A powershell script that shows how to do this can be found at: - https://github.com/robotechredmond/Azure-PowerShell-Snippets/blob/master/AzureRM%20-%20Azure%20SQL%20DB%20Server%20Connection%20Policy.ps1

Upvotes: 0

Harshil Lodhi
Harshil Lodhi

Reputation: 7762

Visual Studio tries to directly connect to the SQL servers using port 1433.

It is highly likely that your proxy allows only 80 and 443 port.

If you can ask your proxy administrator to open up these ports, do that otherwise following are the some of the ways to bypass the proxy.

  1. Use a SSL VPN ( eg. OpenVPN ) . There are free VPN service providers available like VPNBook etc ( do a search to find out more).

  2. Use your phone's hotspot or some other internet connection which doesn't use proxy connection.

Upvotes: 3

Related Questions