在azure web APi上显示500内部服务器错误

时间:2015-10-02 04:42:13

标签: asp.net azure cloud

我在Visual Studio 2013更新4中使用Windows 8.1 pro pc中的EF6开发了一个web api项目,这是我的EF生成的连接字符串

<connectionStrings>
<add name="bcsmdbEntities" connectionString="metadata=res://*/BCSMModel.csdl|res://*/BCSMModel.ssdl|res://*/BCSMModel.msl;
     provider=System.Data.SqlClient;provider connection string=&quot;data source=j01qw1lha2.database.windows.net;
     initial catalog=bcsmdb;persist security info=True;user id=xxxxxx;password=xxxxxxxx;
     MultipleActiveResultSets=True;App=EntityFramework&quot;" providerName="System.Data.EntityClient" />

当我执行GET请求时,它在我的本地计算机上正常工作但在将其作为web应用程序部署在azure之后返回500内部服务器错误。错误详细信息如下

{
"Message": "An error has occurred.",
"ExceptionMessage": "The underlying provider failed on Open.",
"ExceptionType": "System.Data.Entity.Core.EntityException",
"StackTrace": "   at System.Data.Entity.Core.EntityClient.EntityConnection.Open()\r\n   at System.Data.Entity.Core.Objects.ObjectContext.EnsureConnection(Boolean shouldMonitorTransactions)\r\n   at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)\r\n   at System.Data.Entity.Core.Objects.ObjectQuery`1.<>c__DisplayClass7.<GetResults>b__5()\r\n 

任何人都可以帮我找出问题所在吗?提前致谢

1 个答案:

答案 0 :(得分:0)

我发现了问题,实际上是天蓝色的管理员权限问题,问题已解决