简体   繁体   中英

Azure Site-To-Site connectivity and SQL IaaS

If I create a VNet named mySiteToSitevNet and configure it for Site-To-Site connectivity. I create a Virtual Machine assign it to use mySiteToSiteVNet as its network. I Install SQL Server on it.

Do i get Public IP to connect to that SQL Server from my WebApp which does not have VNet associated to it?

If not, how do I make my WebApp connect to that SQL Server and use the database?

There are 2 options:

  1. Since you already have a Sign to Site VPN then you can VPN in from your website's box to enable it to access the SQL and that's the most secure way.

If for some reason you don't want to VPN in, first you need to figure out why you don't want to do this. If there's a really good reason to not VPN in, then continue with setting up direct Internet access to the SQL Server.

  1. To open an endpoint browse to the VM in the Azure portal. Open the properties of the VM in the Azure Portal, then click the “All Settings” option. Then select “Endpoints”. It'll look something like this.

在此处输入图片说明

If you see a “SQL Server” endpoint with 0 ACL Rules then the work is half done (shown above). If there are ACL rules then you should be finished unless you need to add more ACL Rules.

If there is no SQL Server endpoint click the “Add” button at the top of the Endpoints blade. Name the endpoint “SQL Server”, select the protocol TCP, then set the ports to 1433 (or whatever TCP ports you want to use, but 1433 is the default). Select to setup access rules for whoever needs access and block any subnets that don't need access and then OK back to the VM's properties.

在此处输入图片说明

At this point you can connect to the SQL Server instance through whichever method you've setup. If you are using either VPN option you can just connect to the Virtual Machine's network name. If you are going through the public endpoint (again this is REALLY NOT recommended) you'll need to connect to the machines full DNS name.

虚拟网络中部署的任何VM也可以通过公共Internet公开,因此,您的问题的答案是是的,可以为它提供一个实例的公共IP地址( https://azure.microsoft.com/en-us/documentation / articles / virtual-networks-instance-level-public-ip / )或公共负载平衡器后面的端口( https://azure.microsoft.com/zh-cn/documentation/services/load-balancer/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM