title: Why am I getting "The magic number in GZip header is not correct." error using OWIN auth against Azure SQL
body: <p>Nothing on Google or SO relates to this specific problem, so asking a new question. I created a brand new Asp.Net MVC <em>Web Application</em> with the standard <em>user-security</em> option. I also created an empty database in Azure.</p>
  
  <p>I did nothing but change the default connection string to this:</p>
  
  <pre><code>  &lt;connectionStrings&gt;
      &lt;add name="DefaultConnection" 
           connectionString="data source=mydatabase.database.windows.net;initial catalog=Feedback;persist security info=True;user id=LeaveFeedbackuser;password=mypassword;MultipleActiveResultSets=True;App=EntityFramework"
           providerName="System.Data.SqlClient" /&gt;
    &lt;/connectionStrings&gt;
  </code></pre>
  
  <p>and the default connection factory to this:</p>
  
  <pre><code>  &lt;entityFramework&gt;
      &lt;defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework"&gt;
        &lt;parameters&gt;
          &lt;parameter value="v12.0" /&gt;
        &lt;/parameters&gt;
      &lt;/defaultConnectionFactory&gt;
      &lt;providers&gt;
        &lt;provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /&gt;
      &lt;/providers&gt;
    &lt;/entityFramework&gt;
  </code></pre>
  
  <p>On attempting to register (when I would expect it to normally create the <code>AspNetUsers</code> and related tables) I get the following error:</p>
  
  <blockquote>
    <p>The magic number in GZip header is not correct. Make sure you are
    passing in a GZip stream.    Description: An unhandled exception
    occurred during the execution of the current web request. Please
    review the stack trace for more information about the error and where
    it originated in the code. </p>
    
    <p>Exception Details: System.IO.InvalidDataException: The magic number
    in GZip header is not correct. Make sure you are passing in a GZip
    stream.</p>
    
    <p>Source Error: </p>
    
    <p>Line 153:            { Line 154:                var user = new
    ApplicationUser { UserName = model.Email, Email = model.Email }; Line
    155:                var result = await UserManager.CreateAsync(user,
    model.Password); Line 156:                if (result.Succeeded) Line
    157:                {</p>
  </blockquote>
  
  <p>What has any of this to do with GZip and what is causing this error? This has stopped me getting OWIN working with my Azure database for several days now.</p>