简体   繁体   English

Windows Azure上的WCF服务-连接到本地SQL Server数据库

[英]WCF service on Windows Azure - connecting to on-premises SQL Server database

Is it possible to have a WCF service that is running on Windows Azure communicate with a local / on-premises SQL Server database? 是否有可能在Windows Azure上运行的WCF服务与本地/本地SQL Server数据库进行通信?

Alternative options we're considering are: 我们正在考虑的替代选项是:

  • Push the 4 SQL Server databases that the WCF service needs to gather and process data from up to a Azure VM 将WCF服务需要收集和处理数据的4个SQL Server数据库从向上推送到Azure VM
  • Create 4 SQL Azure "clones" of the local / on-prem SQL Server databases and use the data sync feature to keep the Azure clones in sync with the local data. 在本地/本地SQL Server数据库中创建4个SQL Azure“克隆”,并使用数据同步功能使Azure克隆与本地数据保持同步。

Ideally, we'd like to be able to expose the on-premises database (via the VPN) to the service and hit each of the databases directly. 理想情况下,我们希望能够将本地数据库(通过VPN)公开给服务,然后直接访问每个数据库。

Actually, an easier solution would be to host your WCF service internally and expose the service via an Azure Service Bus Relay . 实际上,一个更简单的解决方案是在内部托管WCF服务并通过Azure Service Bus Relay公开该服务。 The service bus relay supports multiple authentication types for securing the service and no VPN is required. 服务总线中继支持多种身份验证类型以保护服务,并且不需要VPN。 There is a good walk-thru here - .NET On-Premises/Cloud Hybrid Application Using Service Bus Relay . 这里有一个很好的介绍- 使用Service Bus Relay的.NET本地/云混合应用程序 We have successfully used this technique to expose several services to third-party vendors. 我们已成功使用此技术向第三方供应商公开了多项服务。

Yes, you can make outbound connections from any Azure hosted service, whether running in web sites, cloud services or virtual machines. 是的,您可以从任何Azure托管服务建立出站连接,无论是在网站,云服务还是虚拟机中运行。 If you need traffic going through a VPN, you'll need to use cloud services or virtual machines, since web sites can't be added to a virtual network. 如果您需要通过VPN的流量,则由于无法将网站添加到虚拟网络,因此需要使用云服务或虚拟机。

you can set up Site-to-site VPN as shown in this resource - Step-By-Step: Create a Site-to-Site VPN between your network and Azure 您可以如本资源中所示设置站点到站点VPN- 循序渐进:在网络和Azure之间创建站点到站点VPN

I would think of SQL Data Sync for scheduler times and that too for small amounts of data (at least not in millions) 我会考虑将SQL Data Sync用于调度程序时间,也将其用于少量数据(至少不是百万)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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