简体   繁体   English

网站拒绝访问对MS Azure中托管的数据库的访问

[英]Access denied from website to database hosted in MS Azure

I got a simple website hosted on SmarterAsp.net. 我在SmarterAsp.net上托管了一个简单的网站。 The database is hosted on MS Azure. 该数据库托管在MS Azure上。 When I try to log in the app and connect to the db, I got Access is denied error. 当我尝试登录应用程序并连接到数据库时,出现访问被拒绝错误。

[SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. [SqlException(0x80131904):建立与SQL Server的连接时发生与网络相关或特定于实例的错误。 The server was not found or was not accessible. 服务器未找到或无法访问。 Verify that the instance name is correct and that SQL Server is configured to allow remote connections. 验证实例名称正确,并且已将SQL Server配置为允许远程连接。 (provider: TCP Provider, error: 0 - Access is denied.)] (提供者:TCP提供程序,错误:0-拒绝访问。)]

Yes, I allowed the website's IP address in the db's firewall settings. 是的,我在数据库的防火墙设置中允许了网站的IP地址。 The connection string on the website looks like this: 网站上的连接字符串如下所示:

Data Source=sasdb.database.windows.net,1433;Initial Catalog=SaSDB;Persist Security Info=True;User ID=XXX;Password=XXX 数据源= sasdb.database.windows.net,1433;初始目录= SaSDB;持久安全信息=真实;用户ID = XXX;密码= XXX

I am not sure what else to check apart from the allowed IP addresses.. Thank you Petr 除了所允许的IP地址,我不确定还有什么要检查的。

EDIT: Ok, so the site is http://speakasspeaker.info/ there is a test button on the main page called Test, when I click it, it should just return some row count from the database. 编辑:好的,所以该站点是http://speakasspeaker.info/ ,主页上有一个名为Test的测试按钮,当我单击它时,它应该只从数据库返回一些行数。 I went to Azure, get a new connection string which looks like this: 我去了Azure,获得了一个新的连接字符串,如下所示:

Server=tcp:sasdb.database.windows.net,1433;Data Source=sasdb.database.windows.net;Initial Catalog=SaSDB;Persist Security Info=False;User ID=XXX;Password=XXX;Pooling=False;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False; 服务器= tcp:sasdb.database.windows.net,1433;数据源= sasdb.database.windows.net;初始目录= SaSDB;持久安全信息= False;用户ID = XXX;密码= XXX;存储= False; MultipleActiveResultSets = False;加密= True; TrustServerCertificate = False;

Now I got new error 现在我有新的错误

The network path was not found 找不到网络路径

When you click the button it will show you the stack trace.. Thanks 当您单击按钮时,它将显示堆栈跟踪。

如此,它现在可以使用,我必须升级我的托管计划,并且实际上必须允许访问数据库,它的IP地址和端口(1433),并且现在可以使用。

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

相关问题 访问被拒绝连接到SQL Azure数据库 - Access is denied connecting to SQL Azure database 如何使用 R 从托管在 AWS ubuntu 服务器上的 Rstudio Connect 访问托管在 Azure Windows VM 上的 SQL 服务器数据库? - How to access SQL Server database hosted on Azure Windows VM using R from Rstudio Connect hosted on AWS ubuntu server? 筛选对从Web App Azure托管到Azure的sql Server的访问 - Filter access to sql Server hosted to Azure from Web App Azure 从MySQL迁移到MS Azure SQL数据库 - Moving from MySQL to MS Azure SQL Database 从 Azure 恢复 MS SQL 数据库 - Recover MS SQL Database from Azure Azure Data Studio:无法恢复 SQL 服务器数据库 - 拒绝访问 - Azure Data Studio: unable to restore SQL Server database - Access Denied 使用Azure SQL数据库后端在MS Access中添加和编辑表的工作流 - Workflow for adding and editing tables in MS Access with Azure SQL Database Backend 从Android App访问MS SQL数据库 - Access MS SQL database from Android App 我的网站托管在不同的服务器上,但我想使用Azure SQL Server数据库 - My website hosted on different server but I want to use Azure SQL Server database 通过MS Dynamics CRM沙盒插件从中获取来自Azure托管SQL服务器的数据 - Get data from Azure hosted SQL server from with in MS Dynamics CRM Sandbox plugin
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM