Search code examples
vpnazure-virtual-machineazure-virtual-networkhybrid-cloud

is it necessary to have Site-to-Site VPN when using Azure VMs with on-premises database?


I have a VM setup with a default database and a website hosted on IIS. After the website main page is loaded, depending on the credentials, it should replace the default connection with an on-premises database connection. Now is there a way that I simply go to azure portal and make a hybrid connection with VM just like we do with azure websites or is it necessary to have a site-to-site VPN in case of azure VMs?


Solution

  • Now is there a way that I simply go to azure portal and make a hybrid connection with VM just like we do with azure websites or is it necessary to have a site-to-site VPN in case of azure VMs?

    It is possible, you could create a site to site VPN connect your Azure VNet and your local database. After the VPN tunnel is created, your VM could access your local database with private IP, it is more safer because your on-premise database is not exposed on Internet.

    Please refer to this link:Create a Site-to-Site connection in the Azure portal.

    Update:

    If you want to connect your database on public network, you only need open SQL port on Azure VM firewall and NSG, you don't need open create a VPN tunnel.