简体   繁体   English

如何使用Azure网站通过私有IP连接到Sql Server VM

[英]How to connect to a Sql Server VM via private IP with Azure Website

I have an Azure VM with port 1433 endpoint created. 我有一个创建了端口1433终结点的Azure VM。 The internal IP is 110.119.38.72. 内部IP为110.119.38.72。

In my Azure Standard Website Web.Config connstring if have: 在我的Azure标准网站Web.Config中,如果具有:

Server=110.119.38.72;Database=MyDB;uid=username;pwd=password;

I am getting the error: 我收到错误消息:

[Win32Exception (0x80004005): Access is denied]

[SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server.

See screenshot for more details: 请参阅屏幕截图以获取更多详细信息: 在此处输入图片说明

If I change my connection string to the Public IP of my Azure Sql Server I am able to connection. 如果将连接字符串更改为Azure Sql Server的公用IP,则可以连接。

How can I used the Internal IP of my Sql Server VM in my Azure Website? 如何在Azure网站中使用Sql Server VM的内部IP?

By default you can't. 默认情况下不能。 However, Azure websites now support running on a Virtual Network, so (in theory) you should be able to create a vnet and place both your SQL Server vm and the Azure Website on that vnet. 但是,Azure网站现在支持在虚拟网络上运行,因此(理论上)您应该能够创建一个vnet,并将SQL Server虚拟机和Azure网站都放置在该vnet上。 That should enable you to connect to the db using the internal (vnet) ip address of the vm. 这应该使您能够使用虚拟机的内部(vnet)IP地址连接到数据库。 I haven't tried this tho, so no guarantees. 我还没有尝试过,所以不能保证。

暂无
暂无

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

相关问题 Windows Azure网站连接外部SQL服务器 - Windows Azure Website connect external SQL server 为什么我无法通过其公共IP将网站连接到另一台计算机上托管的SQL Server数据库 - Why can't I connect my website to a SQL Server database hosted on another computer via its public ip Ionic 4 - 如何通过Web API将应用程序连接到现有的SQL Server? - Ionic 4 - How to connect app to existing SQL Server via Web API? 允许多个IP地址连接到Windows Azure SQL Server - Allowing multiple IP address connections to Windows Azure SQL Server 如何使用 MVC 中的 API 或 Web 服务将放置在另一台服务器上的 SQL Server 数据库连接到另一台服务器上的网站 - How can I connect my SQL Server database that is placed on another server using API or Web Service in MVC to website that is on a different server Azure网站与Azure VM中托管的网站之间的单点登录 - Single Sign On between Azure website and website hosted in Azure VM IIS 7.5 MVC 5部署的网站将无法连接到SQL Server - IIS 7.5 MVC 5 deployed website will not connect to SQL Server 是否可以将互联网上的网站连接到本地SQL Server数据库? - Is it possible to connect my website that is on the internet to my local SQL Server database? Azure虚拟机中的SQL Server 2012镜像-第二个故障转移应用程序失去连接 - SQL Server 2012 mirror in azure VM - on second failover app loses connectivity 到本地的Azure VPN无法从Azure Web应用程序连接SQL Server - Azure VPN to on-premises cannot connect SQL Server from azure web app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM