C# 无法从Azure网站访问Azure DB服务器

C# 无法从Azure网站访问Azure DB服务器,c#,asp.net-mvc-4,azure,azure-sql-database,C#,Asp.net Mvc 4,Azure,Azure Sql Database,我使用Visual Studio 2013 web Express创建了一个MVC web应用程序。我已经在Azure中为我的机器启用了防火墙规则,我可以从本地机器连接和远程调试我的网站。我有用户SQL Server对象资源管理器来确认我正在连接Azure DB,并且应用程序运行正常 但是,当我将应用程序部署到Azure时,会出现以下连接错误。我已检查以确保该网站具有Azure DB作为链接资源的链接。我已使用FTP连接到该网站,并确认我的web.config中的连接字符串是正确的 这似乎是我的

我使用Visual Studio 2013 web Express创建了一个MVC web应用程序。我已经在Azure中为我的机器启用了防火墙规则,我可以从本地机器连接和远程调试我的网站。我有用户SQL Server对象资源管理器来确认我正在连接Azure DB,并且应用程序运行正常

但是,当我将应用程序部署到Azure时,会出现以下连接错误。我已检查以确保该网站具有Azure DB作为链接资源的链接。我已使用FTP连接到该网站,并确认我的web.config中的连接字符串是正确的

这似乎是我的Azure设置中的一些配置问题,但我不知道还要检查什么。任何建议都将不胜感激

---------------收到错误(用户名和跟踪id已更改)--------------------------

“/”应用程序中出现服务器错误

用户“MyUserName”登录失败。此会话已分配一个 跟踪ID为“xxxxxxxx-xxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx”。提供这个 当您需要帮助时,跟踪客户支持ID。
描述:在执行过程中发生未处理的异常 当前的web请求。请查看堆栈跟踪以了解更多信息 有关错误的信息及其在代码中的来源

异常详细信息:System.Data.SqlClient.SqlException:登录失败 对于用户“MyUserName”。已为该会话分配了跟踪ID “xxxxxxxx-xxxx-xxxx-xxxx-XXXXXXXXXX”。将此跟踪ID提供给 需要帮助时提供客户支持

源错误:

在执行过程中生成了未处理的异常 当前web请求。关于货物来源和位置的信息 可以使用下面的异常堆栈跟踪来识别异常

堆栈跟踪:

[SqlException (0x80131904): Login failed for user 'MyUserName'.
This session has been assigned a tracing ID of 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'.  Provide this tracing ID to
需要帮助时提供客户支持。] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException 异常,布尔断开连接,操作
1 wrapCloseInAction)
+5341687
System.Data.SqlClient.TdsParser.ThroweException和Warning(TdsParserStateObject
stateObj,布尔调用方连接锁,布尔异步关闭)+546
System.Data.SqlClient.TdsParser.TryRun(RunBehavior RunBehavior,SqlCommand cmdHandler,SqlDataReader dataStream,
BulkCopySimpleResultSet bulkCopyHandler,TdsParserStateObject
stateObj、Boolean和dataReady)+1693
System.Data.SqlClient.TdsParser.Run(RunBehavior RunBehavior,SqlCommand cmdHandler,SqlDataReader dataStream,
BulkCopySimpleResultSet bulkCopyHandler,TdsParserStateObject
stateObj)+69
System.Data.SqlClient.sqlinternalconnectionds.CompleteLogin(布尔值
正常)+30
System.Data.SqlClient.sqlinternalconnectionds.AttemptOneLogin(ServerInfo
serverInfo、String newPassword、SecureString newSecurePassword、,
布尔值IgnoresInOpenTimeout,TimeoutTimer timeout,布尔值
带故障切换)+317
System.Data.SqlClient.sqlinternalconnectionds.loginnofilover(ServerInfo
serverInfo、String newPassword、SecureString newSecurePassword、,
Boolean redirectedUserInstance,SqlConnectionString connectionOptions,
SqlCredential凭证,超时超时)+892
System.Data.SqlClient.sqlinternalconnectionds.OpenLoginEnlist(TimeoutTimer
超时,SqlConnectionString连接选项,SqlCredential
凭证、字符串newPassword、SecureString newSecurePassword、,
布尔重定向EduseInstance)+311
System.Data.SqlClient.SqlInternalConnectionDS..ctor(DbConnectionPoolIdentity
标识、SqlConnectionString连接选项、SqlCredential
凭证、对象providerInfo、字符串newPassword、SecureString
newSecurePassword、布尔重定向edUserInstance、SqlConnectionString
用户连接选项,SessionData重新连接SessionData)+646
System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions
选项、DbConnectionPoolKey poolKey、对象poolGroupProviderInfo、,
DbConnectionPool池,DbConnection owningConnection,
数据库连接选项用户选项)+278
System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool
池、数据库连接所有者对象、数据库连接选项、,
DbConnectionPoolKey poolKey,DbConnectionOptions用户选项)+38
System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection
owningObject、DbConnectionOptions用户选项、DbConnectionInternal
旧连接)+732
System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection
owningObject、DbConnectionOptions用户选项、DbConnectionInternal
旧连接)+85
System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection
owningObject,UInt32 WaitForMultipleObjectStimOut,布尔型
allowCreate,仅布尔值EchkConnection,DbConnectionOptions
用户选项,DbConnectionInternal和connection)+1057
System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection
owningObject,TaskCompletionSource
1重试,DbConnectionOptions 用户选项,DbConnectionInternal和connection)+78 System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection、TaskCompletionSource
1重试、DbConnectionOptions
用户选项、DbConnectionInternal oldConnection、DbConnectionInternal&
连接)+196
System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection
外部连接,数据库连接工厂连接工厂,
TaskCompletionSource
1重试,DbConnectionOptions用户选项)+146 System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection 外部连接,数据库连接工厂连接工厂, TaskCompletionSource
1重试,DbConnectionOptions用户选项)+16
System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource
1 重试)+94
[ProviderIncompatibleException: The provider did not return a ProviderManifestToken string.]
   System.Data.Entity.Core.Common.DbProviderServices.GetProviderManifestToken(DbConnection
[ProviderIncompatibleException: An error occurred while getting provider information from the database. This can be caused by Entity