简体   繁体   English

在 azure 上部署 ASP.net MVC 时出错! 访问被拒绝

[英]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.

相关问题 在Azure上部署ASP.NET MVC 5后出现错误 - Error after deploy ASP.NET MVC 5 on Azure ASP.NET MVC 4-401访问被拒绝 - ASP.NET MVC 4 - 401 Access Denied 从Windows Azure(ASP.NET MVC)进行的GMAIL API访问被拒绝访问 - Access is Denied on GMAIL API access from Windows Azure (ASP.NET MVC) 使用 SQL 数据库在 Azure 门户上部署 ASP.NET MVC 应用程序 - Deploy ASP.NET MVC app on Azure portal with SQL database 无法部署 ASP.NET MVC + 对 Azure 做出反应 - Cannot deploy ASP.NET MVC + React to Azure 将 Azure AD 集成到 ASP.NET Core Web 应用程序时更改默认拒绝访问路径 - Changing default access denied path when integrating Azure AD into an ASP.NET Core web app 使用asp.net mvc 3将文件上传到文件夹时,访问被拒绝? - Access denied when uploading files to folder using asp.net mvc 3? ASP.net Web应用程序(不是MVC):访问Google GoogleWebAuthorizationBroker.AuthorizeAsync返回拒绝访问错误 - ASP.net Web Application (Not MVC): Accessing Google GoogleWebAuthorizationBroker.AuthorizeAsync returns access denied error asp.net MVC 4 0x80070005 - Javascript运行时错误:访问被拒绝 - asp.net MVC 4 0x80070005 - Javascript runtime error: access denied ASP.NET MVC:创建性能计数器时拒绝请求的注册表访问 - ASP.NET MVC: Requested registry access denied when creating performance counters
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM