Connect to SQL Azure Database - from Home vs from Office

juni dev 336 Reputation points
2020-06-15T15:38:08.467+00:00

Hi,

I have an Azure SQL database on my test subscription

I'm able to connect to the DB with SSMS from my Home Network (my IP is whitelisted on server and DB azure firewall)

So, the Azure DB connectivity is doable

In order to be able to connect to the DB from the corporate network, I did the following

Added the company machine IP to the Azure firewall whitelist (server and DB firewalls)

Requested an exception to the company firewall to enable this traficc (indication the company machine static IP and the azure DB dns and ip )

But I'm still not able to connect to the DB from the company machine

What logs can I check in Azure to verify if the connection requests are reching azure and with what IP?

Note: I'm a developer, not an admin. So I might need some detail about the type of logs to look for

Many thanks

Azure SQL Database
Azure Firewall
Azure Firewall
An Azure network security service that is used to protect Azure Virtual Network resources.
674 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,068 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Ronen Ariely 15,191 Reputation points
    2020-06-16T02:23:12.583+00:00

    Good day juni, @junidev-0033

    my IP is whitelisted on server and DB azure firewall

    This sound strange since Azure Database does not have any firewall in the database level but only in the logical SQL Server level. Please confirm that you are using Azure SQL Database. I will assume in the meantime that you checked twice the same firewall from two different places in the portal for example.

    Update! To clarify, In my above is a mistake since Azure Database level firewall is available using Transact-SQL.

    Added the company machine IP

    1) In most companies the users are working with internal network and not directly to the internet. This means that the machine IP has no meaning since it is internal IP address. Usually all employees have the same Public IP. At least this how it is in small companies, which has only one Internet service provider (ISP) account and a single router connected to the internet.

    When you connect to the Azure Database, the IP which the firewall see is not your machine internal IP but the shared public IP.

    In order to get your public IP you can use one of the online free services or search Google for: what is my ip

    2) please confirm that your operating system firewall does not block you. remember that you have a firewall in the OS, you have a company firewall, and you probably have a firewall in the router as well. All need to be open to port 1434 and not to blog your machine.

    Requested an exception to the company firewall to enable this traficc (indication the company machine static IP and the azure DB dns and ip )

    1) Make sure the company opened the right port 1434 in the firewall. Usually in companies this port is close since the users only use port 80 and 443 for their browsers

    2) Make an attempt with the help of your IT (the person in-charge on the network) to connect SQL Server which is outside your company. For example try to use one at your home. You can install the free SQL Server express edition for the test. This will confirm if they actually opened everything that they need to and configured the network well.

    remember that there can be multiple configuration beside to the IP address, like port, load balancing, proxy, and so on.

    Please inform us if this solve your needs 🙂

    By the way, As you mentioned, this is not an issue related to the Azure Database according to your description, since you can connect to database from your home. This is an issue, which your company IT should solve (if needed wit h the help of forums in the field of networking).


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.