Unable to connect to azure SQL through Point-to-Site VPN connection - azure

We setup a Point-to-Site azure VPN gateway to allow us to connect to our Virtual Machines and azure SQL instance. The gateway is linked to the Virtual Network where our VM's live, and the Azure SQL has a firewall rule to allow connections from That virtual network. We are able to connect to the VM's but not to the Azure SQL.
I tried linking the Virtual network to the Azure SQL through the firewall settings, it didn't help.

I assume you are using Azure SQL database. It's public and does not deploy in a VNet. Also, VNet Service Endpoints don’t extend to on-premises. So It did not help to connect to Azure SQL database over VPN connection. If you want it to work, you need whitelist your on-premise client public IP address in the firewall of Azure SQL database.
Otherwise, you need to deploy your SQL instance in a VNet, so you need to use Azure SQL Database managed instance. You could follow this quickstart: Configure a point-to-site connection to an Azure SQL Database Managed Instance from on-premises

Related

Connect Azure SQL Server (PaaS) to a VM Scale set

How to connect Azure SQL Server (PaaS) to a VM Scale set. The Azure SQL Server has firewall and other network settings. I just want the common procedure like adding a VNet / subnet..
• With regards to network and firewall configuration, ensure that your Azure SQL Server has allowed inbound connections and traffic over SQL TCP port 1433 from the Azure VMSS if you are configuring this infrastructure in private, internal mode, i.e., within your specified virtual networks only.
• Connections between the same virtual network are allowed by default, thus if the Azure SQL server and the VMSS are in different virtual networks, then only the above connections are required. Also, ensure that outbound as well as the inbound traffic on the VMSS has been allowed on the above said TCP ports in the firewall and the NSG.
• Ensure that SQL Server allows connections over TCP ports, has enabled SQL Server authentication with a SQL login and password with permissions to access the hosted SQL database.
For more clarification, kindly refer the below documentation link for more details: -
https://learn.microsoft.com/en-us/azure/azure-sql/virtual-machines/windows/ways-to-connect-to-sql?view=azuresql#connect-to-sql-server-within-a-virtual-network
https://learn.microsoft.com/en-us/azure/azure-sql/managed-instance/connect-vm-instance-configure?view=azuresql
As above, you can configure a private endpoint for the Azure SQL Database server and then use the SQL Server Management Studio from the VMSS to access the SQL Database server from it using the private DNS FQDN of the private endpoint over the specified subnet only.
Similarly, as shown below in the snapshot, the virtual network subnet for the VMSS is also added as a rule in the selected networks section.

Connect to Azure Sql Managed Instance from on-premise SSMS

I am new to Azure. I am currently trying to migrate the on-premise databases to Azure Sql Managed Instance. I created the resources in Azure. I now like to connect to the database that I created from my on-premise Sql client from the organization Dev LAN. What configuration should be implemented to make all developers able to connect to this Azure Sql Instance. My organization does not allow to use public endpoint and use 3342 port. How should I proceed?
Thanks for the help!
If your Managed Instance has its public endpoint disabled, then you'll have to connect to the private IP.
So your options are:
Get your network engineers to route your "Dev Lan" to the Azure VNet containing the Managed Instance over a Site-to-Site VPN or ExpressRoute
Set up a Point-to-Site VPN from your client machine to the Azure VNet.
Connect over RDP to an Azure VM "jump box" running SSMS in an Azure VNet that can communicate with the Managed Instance.

Cross DB query between Azure SQL Server VM on Azure Gov Cloud and Azure Public cloud

I have an on-premises database which communicates with Azure SQL Sever VM on public cloud using linked server. Now we have a requirement to move the on-prem db to Azure Government Cloud.
After migration to Azure Gov cloud how can I maintain the connection for cross db query between SQL servers on Gov cloud and Public cloud? My understanding is Global vnet peering cannot be maintained between Gov cloud and on-prem cloud.
Is there a way to keep the functionality of cross DB query intact after migration?
One way to solve this would be to move the Azure SQL Sever VM on public cloud to the Azure Gov cloud. When they are both in the same cloud it is possible to do cross server queries.
Since the data on the 2 servers are related, it may be that both belong in the Gov cloud.
While you will not be able to use Global VNET peering between Public & Government clouds, you can use Azure Virtual Network Gateways to establish a VPN between the two clouds. If that is not an option for you, you can configure public IP endpoints for your SQL Servers on both ends. With this option will definitely want to establish firewalls or NSG rules to restrict any other outside traffic.

Unable to connect to Azure SQL through Virtual Network Gateway

I have SQL Azure Database Server (not managed instance). When setup last year, I added Azure Virtual Network Gateway, and I could access the database via the VPN connection, without whitelisting the IP.
We didn't use this connection via gateway since Jan 2020. There was only couple of developers connection but had their IP whitelisted.
Recently, we tried accessing the database using this connection, and it doesn't work. Prompting to whitelist the IP. Has something changed?
It seems that you just enable Azure virtual network service endpoints for your Azure SQL database server (not managed instance) and add this subnet to your SQL network rules. With service endpoint, the traffics go over the Internet but restrict over the network. Service endpoints and Private endpoints are two different things.
To connect to your Azure SQL database via a VPN connection, you could use a private link. Private Link allows you to connect to various PaaS services in Azure via a private endpoint. You could get the detailed steps from https://learn.microsoft.com/en-us/azure/azure-sql/database/private-endpoint-overview
Alternatively, you could try to use a TCP proxy server to forward traffic to the public IP address for SQL Database. Reference: https://argonsys.com/microsoft-cloud/library/using-a-tcp-proxy-to-connect-to-sql-database-over-vpn/

Restricting access to Azure SQL from Azure VM

Since Azure SQL have only DNS address and no IP , we can not enforce ACL's/NSG's on our Azure app VM as it needs to communicate with our Azure SQL..
ACL's/NSG's only have IP ranges restriction..no DNS restrictions..
So , potentially, a hacker who managed to sneak to our Azure App VM , can push its stolen data to what ever IP he wants as long as he is going out in port 1433.
Anyway we can restrict outbound communication from Azure VM only to our Azure SQL ?
You are correct, you can not place an Azure SQL Database within a Virtual Network (VNet). Also, you can only configure a NSG Outbound Security rule to use a Tag that restricts communication to Internet, Azure Load Balancer, or Azure Traffic Manager endpoint. So, unfortunately, it's currently not possible to restrict an Azure VM with NSG to only be able to communicate to a specific Azure SQL Database over Port 1433.
However, on the other side you can restrict the Azure SQL Database firewall rules to only allow your Azure VM to connect to the database by specifying it's IP Address in the SQL Database Firewall rules.

Resources