gpt4 book ai didi

asp.net-mvc - 如何使用 Azure 网站通过私有(private) IP 连接到 Sql Server VM

转载 作者:行者123 更新时间:2023-12-03 03:15:26 25 4
gpt4 key购买 nike

我有一个创建了端口 1433 端点的 Azure VM。内部IP为110.119.38.72。

在我的 Azure 标准网站 Web.Config connstring 中,如果有:

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

我收到错误:

[Win32Exception (0x80004005): Access is denied]

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

查看屏幕截图了解更多详细信息: enter image description here

如果我将连接字符串更改为 Azure Sql Server 的公共(public) IP,我就可以连接。

如何在我的 Azure 网站中使用 Sql Server VM 的内部 IP?

最佳答案

默认情况下你不能。但是,Azure 网站现在支持在虚拟网络上运行,因此(理论上)您应该能够创建一个 vnet 并将 SQL Server 虚拟机和 Azure 网站放置在该 vnet 上。这应该使您能够使用虚拟机的内部 (vnet) IP 地址连接到数据库。我还没有尝试过这个,所以不能保证。

关于asp.net-mvc - 如何使用 Azure 网站通过私有(private) IP 连接到 Sql Server VM,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28042237/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com