title: How to make Entity Framework Code First use the SQL Azure DB?
body: <p>I'm start to learn EF now. What I want to do is use EF code first create new tables in SQL Azure.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>namespace WebApplication2
  {
     public class Blog
     {
         public int UserName { get; set; }
         public int ID { get; set; }
     }
  
     public class BlogContext : DbContext
     {
         public DbSet&lt;Blog&gt; Blogs { get; set; }
  
         public BlogContext() : base("MYEF")
         {
         }
     }
  }
  </code></pre>
  
  <p>Code behind:</p>
  
  <pre><code> protected void Page_Load(object sender, EventArgs e)
   {
          using (var db = new BlogContext())
          {
              var blog = new Blog { UserName = 456 };
              db.Blogs.Add(blog);
              db.SaveChanges();
          }
      }
  </code></pre>
  
  <p><code>Web.config</code>:</p>
  
  <pre><code>&lt;connectionStrings&gt;
      &lt;add name="TestDBContext" 
           connectionString="Server=tcp:mydb.database.windows.net,1433;Database=MYEF;User ID=[Username];Password=[MyPassword];Trusted_Connection=False;Encrypt=True;PersistSecurityInfo=True" 
           providerName="System.Data.SqlClient" /&gt;
  &lt;/connectionStrings&gt;
  </code></pre>
  
  <p>When I check my SQL Azure DB, no table has been created, EF still create the table <code>MYEF</code> in the default SQL Server Express database.</p>
  
  <p>Has anyone done this successfully?</p>