将 Azure VM 与本地数据库一起使用时,是否需要 Site-to-Site VPN?

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

我有一个 VM 设置,其中包含一个默认数据库和一个托管在 IIS 上的网站。加载网站主页后,根据凭据,它应该将默认连接替换为本地数据库连接。 现在有没有一种方法可以让我简单地转到 Azure 门户并与 VM 建立混合连接,就像我们使用 Azure 网站一样,或者是否有必要在 Azure VM 的情况下使用站点到站点 VPN?

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?

有可能,您可以创建站点到站点 VPN 连接您的 Azure VNet 和本地数据库。创建VPN隧道后,您的VM可以使用私有IP访问本地数据库,因为您的本地数据库不会暴露在Internet上,因此更加安全。

请参考这个link:Create a Site-to-Site connection in the Azure portal.

更新:

如果你想在public网络上连接你的数据库,你只需要在Azure VM防火墙和NSG上打开SQL端口,你不需要打开创建VPN隧道。