简体   繁体   English

将Azure Webapp连接到机架空间中的sqlserver

[英]Connect Azure webapp to sqlserver in rackspace

I have hosted a webapp in azure cloud. 我已经在Azure云中托管了一个Webapp。 My MS sql database is in rackspace which only allows a selected ip to access. 我的MS sql数据库位于机架空间中,该机架空间仅允许访问选定的IP。 I can add more IPs to allow access to the rackspace database. 我可以添加更多IP,以允许访问机架数据库。 Which IP address of the Azure webapp should I add in rackspace? 我应该在机架空间中添加Azure Webapp的哪个IP地址? Is it the customDomain's IP address or something else. 是customDomain的IP地址还是其他。

There isn't just one - check out this doc - basically Azure Web Apps run in a server farm that's managed by Microsoft. 不仅仅是一个-请查看此文档 -基本上,Azure Web Apps运行在由Microsoft管理的服务器场中。 Unless you use an ASE (app service environment) you can't change this. 除非您使用ASE(应用服务环境),否则无法更改此设置。 There are a couple of ways you can do what you're trying to do - either 您可以通过两种方法来完成自己想做的事情-

1 - connect over the internet by opening up the ports on your rackspace VM - this will work, but opens you up to the possibility of a network layer attack from any app that someone hosts in Azure. 1-通过打开机架空间VM上的端口来通过Internet连接-这是可行的,但可能会使您受到来自Azure中托管的任何应用程序的网络层攻击的可能性。 (so you're relying on authentication rather than network level protection). (因此,您是依靠身份验证而不是网络级保护)。

2 - use a hybrid connection - this is an app service feature that allows you to download a gateway exe app that runs in your VM in rackspace, and then connects to the app service and creates a secure tunnel to it. 2-使用混合连接-这是一项应用程序服务功能,可让您下载在机架空间中的VM中运行的Gateway exe应用程序,然后连接到该应用程序服务并为其创建安全隧道。 Hence, its outbound from your rackspace DC, you don't need to change firewall settings. 因此,它是从机架空间DC出站的,因此您无需更改防火墙设置。 You can read about it and download the app from the azure portal (in app services). 您可以阅读有关内容,并可以从azure门户下载应用程序(在应用程序服务中)。 You then configure the connection in your azure web app just as if the rackspace VM was on the same network. 然后,您就可以在azure Web应用程序中配置连接,就像机架虚拟机在同一网络上一样。 (eg. you can use "localhost" if the gateway exe is running on the sql server). (例如,如果网关exe在sql服务器上运行,则可以使用“ localhost”)。 This is the approach I'd recommend if you can't move your SQL estate to Azure SQL and hence locate it alongside your web apps. 如果您无法将SQL资产移至Azure SQL并因此将其放置在Web应用程序旁边,则建议使用这种方法。

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

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