locked
Can not connect to Azure sql database from my organization network. RRS feed

  • Question

  • Hi,
    I am not able to connect to azure SQL Database from my organization network.

    But I am able to connect to azure SQL Database from my Private network.

    I spoke to my network team , they adviced me not to open port 1433.as this could be security threat. I tried to connect through azure virtual machine but this is also blocked.

    Could you please let me know the config. steps to config. organization network?

    Is there any other way to configuration the organization network?


    Tuesday, June 27, 2017 12:00 PM

All replies

  • You need to allow your IP address on Azure SQL database, it will deny any connection from unknown IP.

    Go to firewall settings of your Azure SQL database, it will show your current IP automaticlly and just click add and save.

    Here are my two blog posts on Azure SQL Database that may help you(you have instructions how to add IP in Azure SQL Database firewall in first one):

    http://toroman.azurewebsites.net/2016/09/29/azure-basics-part-4-sql-paas/

    http://toroman.azurewebsites.net/2016/10/02/azure-basics-part-5-azure-sql-administration/

    Still this may be your local firewall as well, you may have to allow outbound traffic over 1433 if it's closed.


    Mustafa Toroman, Azure MVP

    • Proposed as answer by rnihad Tuesday, July 18, 2017 2:50 PM
    Tuesday, June 27, 2017 1:30 PM
  • Hello,

    First of all you need to make sure you are able to ping your SQL Azure from a corporate network.

    C:\>ping  <yourSQLAzureserver>.database.windows.net


    Visit Azure portal, click on your SQL Azure server, on the vertical left panel (under Settings) click on Firewall. Now enable “Allow access to Azure services” to allow connections from the Azure VM you have created. Add IPs of your organization to the firewall.


    Port 1433 is required to access a SQL Azure server.


    On your SQL Azure VM configure Windows Firewall.


    Hope this helps,



    Regards,

    Alberto Morillo
    SQLCoffee.com


    Tuesday, June 27, 2017 2:06 PM
  • Hi Mahesh,

    Follow the below steps as mentioned,

    1. Configure the proxy connection as instructed by your organization with port as defined
    2. Connect to the Azure VM host with the IP address and the source port as 22
    3. Once connected to Azure host, run the below command to ensure port forwarding is enabled
      1. “grep Forwarding /etc/ssh/sshd_config”

    To connect to the Azure SQL database, add the Azure SQL database name with the local IP address 127.0.0.1 with the port number 1433 to local hosts file located in C:\Windows\System32\drivers\etc and save the file

    1. One has to get the IP address of Azure SQL database hosted on Azure, to get to know the IP address of it,  just do the nslookup with the dns name of the sql database from command prompt
    2. Add an entry in the SSH tunnel with the port to access it locally and from the Azure side as mentioned below in snapshot


    Monday, August 21, 2017 10:32 AM