[英]Error when deploy ASP.net MVC on azure ! Access is denied
When i deploy a web MVC ASP on azure.当我在 azure 上部署 Web MVC ASP 时。 it reported 1 error:
它报告了 1 个错误:
[Win32Exception (0x80004005): Access is denied]
>
> [SqlException (0x80131904): A network-related or instance-specific
> error occurred while establishing a connection to 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.
Previously I ran on the local host and it was running but when deployed on azure it reported this error.以前我在本地主机上运行并且它正在运行但是当部署在 azure 上时它报告了这个错误。 I have found the above ways and neither in detail nor ineffective!
上面的方法我都找到了,不详细也不无效!
According to your error message and application environment information, I guess you use local sql server database as your application database.根据你的报错信息和应用环境信息,我猜你使用本地sql server数据库作为你的应用数据库。
If you published the application to azure, azure web app couldn't access the local sql database.如果您将应用程序发布到 azure,azure web 应用程序将无法访问本地 sql 数据库。 So you will face this error.
所以你会面临这个错误。
There are two solutions:有两种解决方案:
1.Using azure sql database instead of the local database.(Replace the azure sql database connection string with local sql database connection string) 1.使用azure sql数据库代替本地数据库。(将azure sql数据库连接字符串替换为本地sql数据库连接字符串)
About how to use azure sql database, you could refer to this article .关于如何使用azure sql数据库,可以参考这篇文章。
2.Using Hybrid Connections in azure web app to connect local sql database. 2.在azure web app中使用Hybrid Connections连接本地sql数据库。
More details, you could refer to this article .更多细节,你可以参考这篇文章。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.