Web api working locally but not when deployed to Azure

Viewed 2666

I have a Web Api that I have developed which works perfectly fine when run locally, but when I publish it on Azure, I get a 500 Internal Sever Error.

I have 3 tables in the Database - "Messages", "Users", "Conversations"

The error only happens when I make a call to "Conversations" or "Users". (Conversations contains a list of Users and Users contains a list of conversations.)

I am not sure what is causing this and I don't know how to get more information from this error.

I have tried changing the entity framework connection string, although I didn't really know what I was doing with it. The other connection strings in my web.config seem to be fine.

Is this a database problem or a code first problem?

Web.confg:

<connectionStrings>
<add name="DefaultConnection" connectionString="Data Source=tcp:uqq5j22p7m.database.windows.net,1433;Initial Catalog=AA_db;Persist Security Info=True;User ID=KENH@uqq5j22p7m;Password=Password;Connect Timeout=30;Encrypt=True;MultipleActiveResultSets=True;"
  providerName="System.Data.SqlClient" />
<add name="AcademicAssistantContext" connectionString="Data Source=tcp:uqq5j22p7m.database.windows.net,1433;Initial Catalog=AA_db;Persist Security Info=True;User ID=KENH@uqq5j22p7m;Password=Password;Connect Timeout=30;Encrypt=True;MultipleActiveResultSets=True;" 
  providerName="System.Data.SqlClient" />

<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
  <parameters>
    <parameter value="Data Source=.; Integrated Security=True; MultipleActiveResultSets=True" />
  </parameters>
</defaultConnectionFactory>
<providers>
  <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>

2 Answers
Related