我在发布到Azure服务器后尝试重置密码时收到此错误。但是,它适用于本地主机和所有其它功能像注册,ConfirmEmail和登录现场工作..等 错误:ResetPassword上的Asp.Net Identity 2.0无法连接到SQL Server数据库。Azure web应用程序上的错误
Unable to connect to SQL Server database. Method Message:, LogException: System.Web.HttpException: Unable to connect to SQL Server database. ---> System.Data.SqlClient.SqlException: 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. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
在蔚蓝我的连接字符串的样子:
Server=tcp:server.database.windows.net,1433;Database=MyDb;User ID=username;Password=password;Trusted_Connection=False;Encrypt=True
与选项Custom
我不能在我身边重现这个问题,'ChangePassword'功能在我的web应用程序中可以在本地和Azure上运行。你可以尝试[远程调试](https://docs.microsoft.com/en-us/azure/app-service-web/web-sites-dotnet-troubleshoot-visual-studio#remotedebug)你的网络应用程序来检查控制器动作''ChangePassword(ChangePasswordViewModel模型)''中'dbcontext'的连接。此外,如果可能的话,你可以分享你的项目,然后我可以测试你的代码来找到问题。 –
验证您的Azure *服务器名称*和*防火墙规则* – Jayendran