Connectivity to Azure Managed SQL Instance from local SSMS - azure-sql-database

I have created a Azure managed sql instance. We have peered the vnet of both managed instance and the local VM vnet. Our organization doesnot allow installing Point-to-site vpn on current VM.
Please advice, how can we connect to managed sql instance from on-premises sql server (SSMS).
Thanks in advance.

Since you try to connect from a SSMS installed on a host located on-premises, on the routing table that is added to the subnet where SQL Managed Instance is deployed, add another route to the routing table for your on premise subnet with next hop Virtual Network Gateway.
Make sure NSG (Network Security Group) rules allow communication between the subnets on port 1433 for this connection.
Please also ensure that you enabled 1433 outbound on the host Windows Firewall, as this will also not be permitted by default.

Related

Can't reach my SQL Server hosted in a Windows Server VM, any ideas?

Well, I'm having the following situation.
I'm trying to set up a testing environment which consist of having a SQL Server on a Windows Server VM hosted on Google Cloud Platform (GCP). So far I've installed SQL Server on the VM and configured an instance with SQL authentication. Then I installed SMSS to access using the instance name and my credentials. At this point everything works well.
The problem comes when I try to access my SQL Server via SMSS from another computer. As the instance I'm using my GCP VM IP Adress and the credentials I've created before. The error is as follows:
So far I've done the following configurations:
Enable TCP/IP via SQL Server configuration manager.
I made sure that port 1433 was properly configured in the TCP/IP properties.
Created a new inbound rule on the Firewall to allow TCP connections using port 1433.
On the SMSS, checked that allow remote connections is enabled.
Restarted SQL Services from SQL Server configuration manager and services.msc
With above configurations it should work! But I've no idea what's happening.
Anyone who could give me a hint of how this could be solved, I'd appreciate it.

Connecting web app to SQL Server on Azure VM

I have a SQL Server on Azure VM and I am trying to connect to it from my web app. Can someone point me in the right direction?
I have searched and I have not found one where it connecting to SQL on VM (iAAS). I have only seen tutorials connect to the SQL Server (PAAS). Any help appreciated.
SQL Server on an Azure VM is exactly the same as connecting to SQL Server on a physical server or a VMWare VM.
You will need to ensure that the VM has either a static IP Address or a DNS name. This is what you would use to connect to it from your client. You will also have to ensure that you deal with firewalls.
Is your client also an Azure VM or is it on-premises?
Here's two Azure documents may help you:
Connect to a SQL Server Virtual Machine on Azure.
This topic describes how to connect to your SQL Server instance running on an Azure virtual machine.
Connect your application to Azure SQL Database managed instance.
Today you have multiple choices when deciding how and where you host your application.Whatever choice you made, you can connect it to a Managed Instance.
Hope this helps.

Azure app service (ASE) SQL Azure connection

I have an app service located inside the app service environment(ASE). I have a virtual network which I have put ASE into the subnet in the Vnet.
What I am trying to do is, I am trying to connect SQL Azure endpoint which is not in Vnet or my azure tenant. ASE has an outbound IP address and when I try to tcpping to azure SQL endpoint, it is responding me without any issue.
The problem is when I try to connect SQL endpoint inside the application, I am getting "Cannot open server" error. It usually happens when there is firewall in SQL Azure endpoint. I have checked log analytics (in target SQL endpoint) and saw my app connection is blocked but when I check the client IP, it shows me private IP of ASE. I really don't understand how it can be possible? I would see my public ip in there, since ASE is external ASE.
Do you have any idea how that can be possible?
If you have enabled the virtual network service endpoint for Microsoft.Sql in the ASE subnet, When you connect to your Azure SQL server with service endpoints turned on, the source IP of SQL connections will switch to the private IP space of your VNet.
If so, you need to allow the given VNet/subnet by specifying it in the VNet firewall rules of the SQL server. If you do not want to use a virtual network service endpoint, you can whitelist the outbound IP address of the application in the firewall of the SQL server.
For more information, you could read the blog1 and blog2.

Connect Remotely to SQL Server Express instance hosted on Google Compute Engine

I'm trying to access SQL Server Express installed on Windows Server 2012 on Google Compute Engine VM. I have assigned STATIC IP to the instance and also added an exception to the firewall in Windows for port 1433 as well as in via console area of Compute Engine and allowed my IP in authentication.
I tried connecting the instance remotely via STATIC IP and Instance Name (IP\instancename) using SQL Server authentication, I have also configured SQL Server to accept remote connections as well as enabled TCP/IP from Configuration Area.
I'm still unable to connect to the Instance remotely can any one suggest me how to do.

Why can I not connect to SQL Server using IP address, but works with server name?

I have a server hosted in Amazon's cloud (EC2, AWS), where I have SQL Server installed. With SSMS on the server, I can connect to the server instance using the Amazon server name and the SQL Server instance. However when I use the IP address, I cannot connect.
I have Allow Remote Connections to Server checked.
Similarly, I am unable to connect to the SQL Server instance remotely.
How can I resolve this?
Ensure you have enabled port 1433 to your specific public ip address in the appropriate security group.
You may also have to update the windows firewall config to allow the service to accept connections.
JL