title: MS Azure/Code-First: Login failed for user
body: <p>I want to deploy my ASP.NET application to MS Azure (and SQL Azure). The application is using code-first.</p>
  
  <p>After publishing my application and calling the corresponding URL I receive an error message saying: </p>
  
  <blockquote>
    <p>Login failed for user 'myUserName'. This session has been assigned a tracing
    ID of '8beaff1c-629f-45b3-991b-228425bc30a4'.Provide this tracing ID
    to customer support when you need assistance.</p>
  </blockquote>
  
  <p>I'm pretty sure this is due to connection strings in my config files.</p>
  
  <p>Here is the relevant extract from my web.config:</p>
  
  <pre><code>&lt;connectionStrings&gt;
      &lt;add name="dbContext" 
           connectionString="server(local)\SQLEXPRESS;database=myDB;integrated security=true;MultipleActiveResultSets=True" 
           providerName="System.Data.SqlClient" /&gt;
  &lt;/connectionStrings&gt;
  </code></pre>
  
  <p>And here is the corresponding web.release.config:</p>
  
  <pre><code>  &lt;connectionStrings&gt;
      &lt;add name="ApplicationServices" connectionString="Server=tcp:xt1rnwvt89.database.windows.net;Database=myDB;User ID=myUserName@xt1rnwvt89;Password=myPassword;Trusted_Connection=False;Encrypt=True;MultipleActiveResultSets=True;" xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/&gt;
      &lt;add name="dbContext" connectionString="Server=tcp:xt1rnwvt89.database.windows.net,1433;Database=myDB;User ID=myUserName@xt1rnwvt89;Password=myPassword;Trusted_Connection=False;Encrypt=True;MultipleActiveResultSets=True;" xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/&gt;
    &lt;/connectionStrings&gt;
  </code></pre>
  
  <p>I'm not sure if I need both the <code>ApplicationServices</code> and <code>dbContext</code> settings...?</p>
  
  <p>Of course the credentials given above are anonymized. But the real credentials should be correct, because I can successfully connect to my Azure database with SQL Server Management Studio (SSMS).</p>
  
  <p>I already checked several documentations and tutorials like <a href="https://www.windowsazure.com/en-us/develop/net/tutorials/web-app-with-sql-azure/" rel="noreferrer">https://www.windowsazure.com/en-us/develop/net/tutorials/web-app-with-sql-azure/</a>, but I couldn't find a solution yet. Everything seems to be ok.</p>
  
  <p>Does anybody have an idea? </p>